Communicate data from one widget to another
Send data from one widget to another widget
What is $scope and $rootScope ?
$scope is a JavaScript object that refers to the application data.
The $rootScope acts as a global variable. All the $scopes of an AngularJS application are children of the $rootscope.
1. Broadcast/Emit the data
$rootScope.$broadcast('showIncidentDetails’, variable);
$rootScope.$emit('showIncidentDetails’, variable);
2.Receive the data
$rootScope.$on('showIncidentDetails', function(event,data) {
$scope.showForm= data;
});
