标签:blank tar log rootscope pst angular com tps asc
run方法用于初始化全局的数据,仅对全局作用域起作用。
举个栗子吧:
<script type="text/javascript">
var m1 = angular.module(‘myApp‘,[]);
m1.run([‘$rootScope‘,function($rootScope){
$rootScope.name = ‘hello‘;
}]);
console.log( m1 );
</script>
标签:blank tar log rootscope pst angular com tps asc
原文地址:http://www.cnblogs.com/huangshikun/p/7080992.html