我们总是使用属性ng-app。
<body ng-app="MyApp">
...
</body>
angular.js的代码是如何检测到这一点并安装特殊监视程序的?
也许有这样的功能?
function onHtmlTagEncounter(tag){
if(tag.hasAttribute("ng-app")){
//Scan document and do interpolation and other...
}
}
startupModule.js
(function () {
'use strict';
let app = angular.module('startupModule', []);
app.controller('controller1', function () {
// do this work on loading...
});
app.controller('controller2', function () {
// do this wor