- Starting with Chrome version 45, NPAPI is no longer supported for Google Chrome.
- We have detected you are using Google Chrome and might be unable to use the Java plugin from this browser.
- AngularJs : Creating multiple ng-app in single page
- In the method a root ng-app is created within or tag then define other multiple ng-app and inject them in root ng-app as dependencies.
- In the method, first ng-app is auto-bootstrapped by Angular and the second ng-app module is bootstrapped manually.
In above program two ng-app named primaryApp and secondaryApp with their own controller named primaryController and secondaryController are created. These controllers have their own scope variable “name”. When above program runs then output is as follows :
This shows that only the first ng-app will work as a result “primaryApp” work as expected whereas “secondaryApp” does not. There are various ways for running multiple ng-app in an HTML document.
Method 1: Inject modules in the root app as dependencies
Method 2 : Bootstrap the defined second module manually.
In this method, first ng-app is auto-bootstrapped by Angular and the second ng-app module is bootstrapped manually.