-
-
单个参数调用angular.module(),用来取得该模块而不是定义新的
-
这样就可以在不同的地方定义app的controller而不用通过全局变量
angular.module('myapp').controller('xxController',function(){});
-
-
在controller中的document ready事件下运行代码
-
angular.module('myapp') .controller('MyCtrl',function MyCtrl($scope) { angular.element(document).ready(function () { console.log('Hello ,document is ready!'); });});