JSFiddle - React, Tailwind, and code Playground
by blashadow
HTML
<div ng-app='test'>
<div ng-controller='uno'>
{{ message }}
</div>
<div ng-controller='dos'>
{{ message }}
</br>
<button ng-click='sun()'>Nice</button>
</div>
</div>
<script>
var app = angular.module('test',[])
app.controller('uno',function($scope){
$scope.message = 'uno contorller';
$scope.$on('nice',function(data){
alert('nice ' + data);
});
})
app.controller('dos',function($scope,$rootScope){
$scope.message = 'dos controller';
$scope.sun = function(){
$rootScope.$broadcast('nice',{nice:'hola'});
}
})
console.log(app)
</script>