JSFiddle - React, Tailwind, and code Playground
HTML
<div id="parent" ng-controller="ParentCntl">
This is {{get()}}.
<div id="child" ng-controller="ChildCntl">
</div>
</div>
JavaScript
function ParentCntl($scope) {
$scope.msg = "";
$scope.get = function(){
$scope.$broadcast ('someEvent');
return $scope.msg;
}
$scope.$on('pingBack', function(e, data) {
$scope.msg = data;
});
}
function ChildCntl($scope) {
$scope.$on('someEvent', function(e) {
$scope.$emit("pingBack", $scope.get());
});
$scope.get = function(){
return "LOL";
}
}