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
18
votes
1 answer

How to nest ng-view inside ng-include?

When trying to add an ng-view inside an ng-include, nothing happens. e.g. in the following code, when themes/midnight/index.html holds an ng-view, no view is rendered: However, if I use…
ccoroom
  • 678
  • 8
  • 22
16
votes
2 answers

Angular (1.5.8) Dynamic Components

I'm trying to build a sort of dynamic dashboard using Angular 1.5.8. I've made decent progress up until the final hurdle. Which is actually rendering the dynamic component. I've tried 2 options, either adding a ui-view and programatically passing…
Rohan Büchner
  • 5,052
  • 4
  • 57
  • 98
15
votes
1 answer

How to attach navbar only on certain pages using ui-router?

How to display a navbar on every page except landingpage, so that not have to attach a navbar file on each of needed pages? Now I have enclosed navbar on main app layout, how it should be handled to keep it DRY? Demo (with navbar on each…
14
votes
2 answers

Angularjs - Charts.js: Same chart element doesn't redraw on other view

I am new to angularjs, trying to create my first directive. I am creating a directive to load Charts.js2.0(beta) into my application. I have 2 views managed by angular-route, both html view has ng-included a html page that contains only…
14
votes
1 answer

What file path would I use with ng-include?

My angular project's path is like this web server.py ##flask server program app static app.js controllers.js etc... templates index.html home.html index.html