Yes, we can have more than one ng-app in one angular application. But the thing that we have to remember is, angular js bootstrap the first ng-app by default. if we want to bootstrap the another ng-app then we have to do it explicitly by adding angular.bootstrap.
Note: You should not use the ng-app directive when manually bootstrapping your app.
Eg: angular.bootstrap(document.getElementById("div1"),['myApp']);
Note: You should not use the ng-app directive when manually bootstrapping your app.
Eg: angular.bootstrap(document.getElementById("div1"),['myApp']);
No comments:
Post a Comment