标签:cti att span 如何 template read attr ret ready
<html>
<head>
<script src="angular.js"></script>
<script>
// 创建moudle1
var rootMoudle = angular.module(‘moudle1‘, []);
rootMoudle.controller("controller1",function($scope){$scope.name="aty"});
// 创建moudle2
var m2 = angular.module(‘moudle2‘, []);
m2.controller("controller2",function($scope){$scope.name="aty"});
// 页面加载完成后,再加载模块
angular.element(document).ready(function() {
angular.bootstrap(document.getElementById("div1"),["moudle1"]);
angular.bootstrap(document.getElementById("div2"),["moudle2"]);
});
</script>
<head>
<body>
<div id="div1" ng-controller="controller1">div1:{{name}}</div>
<div id="div2" ng-controller="controller2">div2:{{name}}</div>
</body>
</html>
使用angular.bootstrap() 完成模块的手动加载
标签:cti att span 如何 template read attr ret ready
原文地址:http://www.cnblogs.com/yu-709213564/p/6130528.html