problem description
angular broadcasts a data in the controller using $scope.$emit (), and accepts that assigning a variable to a variable is always undefined using $scope in other controllers.
related codes
$scope.$emit ("changeData", 0); / / broadcast a changeData variable upwards in controller 1 with a value of 0
$scope.$on ("changeData", function (event,data) {
console.log(data); //data
$scope.componentRturn=data; //
});
console.log ($scope.componentRturn); / / undefinde
/ / Controller 2 to accept