<!DOCTYPE html>
<html>
<head lang="zh_CN">
<meta charset="UTF-8">
<title>AngularJS Source Code Analysis</title>
<script src="source/angular.min.js" type="text/javascript"></script>
<script src="source/angular-route.min.js" type="text/javascript"></script>
</head>
<body>
<div ng-app="myApp-0" ng-controller="nameCtrl">
<input type="text" ng-model="age"/>{{ demo }}--{{ age }}
<ul>
<li ng-repeat="val in names" ng-bind="val"></li>
</ul>
</div>
<!-- 并行启动多个ng-app -->
<div id="test-0" ng-controller="testCtrl_0">
<p>{{content.message}}</p>
</div>
<div id="test-1" ng-controller="testCtrl_1">
<p>{{content.message}}</p>
</div>
</body>
<script>
var myApp_0 = angular.module("myApp-0", []);
myApp_0.controller('nameCtrl', function ($scope, $rootScope){
$scope.names = ["shen", "amy", "sereno"];
$scope.age = 24;
$rootScope.demo = "demo";
});
var myApp_1 = angular.module("myApp-1", []);
myApp_1.controller('nameCtrl-1', function ($scope, $rootScope){
$scope.names = ["shen-1", "amy-1", "sereno-1"];
$rootScope.age = 24;
});
// 并行启动多个 ng-app
var myApp1mod = angular.module('test-0',[]);
myApp1mod.controller('testCtrl_0',function($scope){
var content= {};
content.message = "Hello Test-0";
$scope.content= content;
});
var myApp2mod = angular.module('test-1',[]);
myApp2mod.controller('testCtrl_1',function($scope){
var content= {};
content.message = "Hello Test-1";
$scope.content= content;
});
angular.element(document).ready(
function (){
angular.bootstrap(document.getElementById("test-0"), ["test-0"]);
angular.bootstrap(document.getElementById("test-1"), ["test-1"]);
}
);
</script>
</html>
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有