< body ng-app= "app" >
<div ng-controller="parentContrl">
<h1>{{name}}</h1>
<div ng-controller="childContrl">
<h1>{{message}} </h1>
</div>
</div>
< / body >
< / html >
< script >
var app = angular.module("app", []);
app.controller("parentContrl", ["$scope", function ($scope) {
$scope.name = "hello"
$scope.$broadcast("call", $scope.name)
}]);
app.controller("childContrl", ["$scope", function ($scope) {
$scope.$on("call", function (e, data) {
$scope.message = data;
})
}])
< / script >