How to use ng-include?


What value should be passed to ng-include attribute so I could place multiple html pages onto a single page? Will the scope be shared between all of the pages?


You pass in the relative path of the page but must surround it in single quotes because it is an Angular expression:



The Visualisations sample in Canvas uses the ng-include:

If you want more explanation about ng-include, you can have a look at the following help article:


The path used in ng-include has to be relative to the url in the browser. So if the file is in the folder html/page.html it would be:



I found it’d better to put ng-include in the end of the page (after a table), if modals are used in ng-include html files. Otherwise modal pop-ups behaviour can be strange, I guess because of scope variables updating is waiting for the table refresh.