\$rootScope.\$on is not listening to the event broadcasted
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2017 11:07 PM
Hi All,
I have braodcasted an event in a widget, but the $on is not listening to the event
below is my code, let me know for any mistakes
Broad cast event
function($scope, $http, spUtil, $rootScope, $sce) {
/* widget controller */
var c = this;
this.onClick = function($event){
$rootScope.$broadcast('prepopulateItem', c.data.task_sysid);
};
}
Listening event in SC Catalog Item widget
$rootScope.$on('prepopulateItem', function(event,obj) {
$scope.data.sc_cat_item._fields["IO:8d23d26fdbbab24096fcf9971d961955"].value = 'complaint';
$scope.data.sc_cat_item._fields["IO:44b71623db3eb24096fcf9971d961922"].value = 'Option_case_Ticket';
$scope.data.sc_cat_item._fields["IO:02dde3afdb76364096fcf9971d96199d"].value = obj;
});
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2017 11:21 PM
The above two widgets placed on same page?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2017 11:27 PM
Hi Giri,
The above two widgets are in different pages.
Thanks and Regards,
Chandrashekar BN
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2017 11:46 PM
Once test by keeping widgets in same page and try whether communication is happening or not.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2017 12:19 AM
Hi,
I tried in my personal instance by adding the widgets in same page and It was listening.
But my requirement is to send the information from widget in one page to widget in another page.
Can this be accomplished?
Thanks and Regards,
Chandrashekar BN