
#tạo 2 controller là control1 và control2
var test = angular.module('mytest',[]);
var test = angular.module('mytest',[]);
 test.controller('control1',function($scope)
{
{
   $scope.tieude = "thuộc tính tieude nằm trong control1";
});
 test.controller('control2',function($scope)
{
{
   $scope.tieude = "thuộc tính tieude nằm trong control2";
});
<body ng-app="mytest">
<div ng-controller="control1">
{{tieude}}
</div>
<div ng-controller="control2">
{{tieude}}
</div>
</body>
<div ng-controller="control1">
{{tieude}}
</div>
<div ng-controller="control2">
{{tieude}}
</div>
</body>
<body ng-app="mytest">
	<div ng-controller="control1">
		{{tieude}}
       <input type="text" ng-model="message"/>
        {{message}}
	</div>	
	<div ng-controller="control2"> 
		{{tieude}}
        <input type="text" ng-model="message"/>
        {{message}}
	</div> 
</body>
$rootScope
$rootScope: chứa toàn bộ dữ liệu và phân phối nội dung chung cho tất cả controller sang view.
 var test = angular.module('mytest',[]);
 test.controller('control1',function($scope, $rootScope)
{
{
   $rootScope.tieude = "thuộc tính tieude nằm trong control1";
});
 test.controller('control2',function($scope)
{
{
});
