标签:
1 <!DOCTYPE html> 2 <html > 3 <head> 4 <meta charset="UTF-8"> 5 <title>Title</title> 6 </head> 7 <body> 8 <div ng-app="myApp"> 9 <div ng-controller="ParentController"> 10 {{name}} 11 <br /> 12 {{name1.value}} 13 <div ng-controller="ChildController"> 14 {{name}} 15 <br /> 16 {{name1.value}} 17 </div> 18 </div> 19 </div> 20 <script src="../angular-1.5.8/angular.js"></script> 21 <script> 22 var app = angular.module(‘myApp‘,[]); 23 app.controller(‘ParentController‘,function($scope){ 24 $scope.name = "1"; 25 $scope.name1={}; 26 $scope.name1.value="2"; 27 }); 28 app.controller(‘ChildController‘,function($scope){ 29 //$scope.name = "3"; 30 //$scope.name1.value="4"; 31 }); 32 33 </script> 34 </body> 35 </html>
标签:
原文地址:http://www.cnblogs.com/NickCarter/p/5966468.html