Search code examples
angularjsng-controllerangularjs-ng-include

Angular ng-include and specifying controllers


Suppose I have index.html which has mainCtrl as its controller. If I use an ng-include in index.html to include partial html code that is saved on a separate page, does the included page have the mainCtrl or do I need to specify it again on that page?


Solution

  • mainCtrl and it's scope will be also available in your included part.