标签:
1、关于ng-app、angular.module和ng-controller。
<html ng-app="myApp"> ... ... <div ng-controller="Aaa"> <p>{{name}}</p> </div> <div ng-controller="Bbb"> <p>{{name}}</p> </div> ----JS--- var m1 = angular.module(‘myApp‘,[]); m1.controller(‘Aaa‘,[‘$scope‘,function($scope){ $scope.name = ‘hello‘; }]); m1.controller(‘Bbb‘,[‘$scope‘,function($scope){ $scope.name = ‘hi‘; }]);
1
标签:
原文地址:http://www.cnblogs.com/newh5/p/4981268.html