Monday, August 8, 2016

Can we have more than one ng-app one page of Angular Js?

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']);

No comments:

Post a Comment