Questions tagged [angularjs-ng-include]

Fetches, compiles and includes an external HTML fragment.

Fetches, compiles and includes an external HTML fragment.

Usage

As element: (This directive can be used as custom element, but be aware of IE restrictions).

<ng-include
  src=""
  [onload=""]
  [autoscroll=""]>
...
</ng-include>

As attribute:

<ANY
  ng-include=""
  [onload=""]
  [autoscroll=""]>
...
</ANY>

As CSS class:

<ANY class="ng-include: ; [onload: ;] [autoscroll: ;]"> ... </ANY>

Reference:
https://docs.angularjs.org/api/ng/directive/ngInclude

467 questions
0
votes
2 answers

Disable autoscroll for only certain anchor tags on a page

I have created an AngularJS service that dynamically inserts a div into the DOM with content from a template and a custom controller that handles the bindings and directives within the template. The service, called myService, allows you to pass in…
0
votes
1 answer

AngularJS - ng-click does not remove previous click's modifications when clicked again

So I am trying to acomplish this example: http://jsfiddle.net/pkozlowski_opensource/WXJ3p/15/ However, for some reason, when I click on one div, and then on another, it does not remove the "active" class from the previous div so it highlights both ,…
0
votes
1 answer

Angularjs - how to access an ng-include template's data to modify it through another template within the same controller

What I am trying to acomplish is to have two different templates within my app: one is generated through ng-repeat like so:
And the other is generated like this:
0
votes
1 answer

AngularJS: Scope in ng-repeat

I am trying to ng-include some partials dynamically. I realize there may be other ways to do this, but I want to understand why this way isn't working. I have a controller defined as so: auditApp.controllerModule.controller('LayoutCtrl',…
-1
votes
1 answer

Best practice for replacing ng-include when upgrading from angularjs to angular?

To my dismay angular no longer supports the ng-include directive. My code base uses hundreds of shared partial html files. I cant seem to find any documentation. Can anyone point meet in the right direction. Is the best practice just to componentize…
blankpage985
  • 43
  • 10
-1
votes
1 answer

Change ng-include with controller

I have a tab structure made of ng-reapet which shows the content of each tab in a panel (the same one but diff content). I have added
in each tab-panel to display the…
yanivz
  • 128
  • 12
-1
votes
1 answer

Display a JSP page from a URL in a modal popup in AngularJS

I am trying to load a JSP page inside a modal in AngularJS. The JSP page have lot of scripts and so I wont be able to take the source and create a separate template. The URL is from a different server but I have CORS enabled in my server. Is there…
Phoenix
  • 251
  • 7
  • 25
-1
votes
2 answers

How to redirect to another HTML page by button click in a single page app using angular?

I am working on a single page application that contains sign in and registration and some other functionalities.I have page index.html that includes signin.html and register.html ,and the submit in the sign in should direct the user to…
user6561572
  • 199
  • 12
-1
votes
1 answer

Angular use ng-include to include a template that include others

i'm trying in my app to include a template (already shown) that include other template. index.html Tasks Overview
Simone Campagna
  • 683
  • 1
  • 6
  • 16
-1
votes
1 answer

How to compile ng-include html file in a variable

i'm storing a html string in a scope object and want to pass it to a variable $scope.template1 = "div ng-include="'/app.html'"
" Then i want to pass this template1 to my bootstrap template option with the output of $scope.template1 …
rUI7999
  • 109
  • 1
  • 2
  • 16
-1
votes
1 answer

ng-include not working like it supposed to

I have a form and it has several buttons. When clicking one of this button, this form should remove and load another form. I'm trying to do this using ng-include method. I have done a similar thing before and got it to work. But I cannot understand…
CraZyDroiD
  • 5,264
  • 21
  • 64
  • 138
-1
votes
2 answers

Include template on ng-click in angulajs

I have created discussion forum application in angularjs. Once the user clicked the reply button on the post, I want to show the editor which is in the separate html file. How can I include that template on clicking the ng-click under that specific…
-1
votes
1 answer

Angular ng-include, can it take an http address?

I am working with angular and am making liberal use of the ng-include directive.
This is working great, so long as the file partials/header.html is found in my file system at the…
Zack
  • 11,342
  • 19
  • 69
  • 105
-1
votes
1 answer

AngularJS - ngInclude does not render expressions in events

I'm having a problem while trying to render another HTML with Directives in AngularJS. if the template HTML is without events, It works just fine : would be rendered to :
Cypher
  • 1,791
  • 2
  • 20
  • 32
-1
votes
1 answer

Include template from file in AngularJS

Not sure if I got it wrong. I'm not able to include template from a file via script tag. Any idea? Template: