Angularjs in depth
This series is really good, is I want to learn in-depth content.
http://syaning.com/2015/07/16/dive-into-angular-1/
In general, there is only one app on a page, but multiple apps on a page can coexist. Through the analysis of the face source, you can know that only the first application will start automatically, so the rest of the application needs to be started manually, for example:
<DivID= "App1"Ng-app= "MyModule1"> <DivNg-controller= "CTRL1"> </Div></Div><DivID= "App2"Ng-app= "MyModule2"> <DivNg-controller= "Ctrl2"> </Div></Div><Script> varMyModule1=Angular.module ('MyModule1', []); Mymodule1.controller ('CTRL1', ['$scope', function($scope) {$scope. Name= 'Alex'; }]); varMyModule2=Angular.module ('MyModule2', []); Mymodule2.controller ('Ctrl2', ['$scope', function($scope) {$scope. Greeting= 'Hello'; }]); Angular.element (document). Ready (function() {Angular.bootstrap (document.getElementById ('app2'), ['MyModule2']); });</Script>
Angular how to launch two apps in one page at the same time?