JSFiddle - React, Tailwind, and code Playground
HTML
<div ng-app="rootModule">
<div ng-controller="firstController">
Click count : {{count}}
<input type="button" value="click" ng-click="countCal()" />
</div>
<div ng-controller="secondController">
Click Count : {{count}}
<input type="button" value="click" ng-click="countCal()" />
</div>
<div ng-controller="thirdController">
Click Count : {{count}}
<input type="button" value="click" ng-click="countCal()" />
</div>
</div>
JavaScript
var app = angular.module('rootModule',[]);
app.controller('firstController',['$scope','$rootScope',function($scope, $rootScope){
console.log('first');
}]);
app.controller('secondController',['$scope','$rootScope',function($scope, $rootScope){
console.log('scrond');
}]);
app.controller('thirdController',['$scope','$rootScope',function($scope, $rootScope){
$rootScope.count = 0;
$rootScope.countCal = function(){
$rootScope.count = $rootScope.count + 1;
}
}]);