Closed hugsbrugs closed 8 years ago
I believe what you want here is growlMessages.deleteAllMessages()
I'm using ng-route instead of ui-route, but It's a minor code change away.
As ng-route there's no "state" definition I had to add a property called "group" to know when I'm changing business scopes.
.run(['$rootScope', 'growlMessages', function($rootScope, growlMessages){
$rootScope.$on('$routeChangeSuccess', function(event, current, previous, rejection){
if (current && previous && current.group !== previous.group) {
growlMessages.destroyAllMessages();
}
});
}]);
Thanks @flaviocysne ,
I'll give growlMessages.destroyAllMessages(); a try because that was the function called I missed !
Hi I have growls with disabled countdown (ttl:-1) and thus when changing route, I would like to reset those notifications (only the inline ones), so that when I come back, I don't see them unless they are fired again !
For the router part, I know where to start :
But for growl reset I'm completely lost : what object should I look at ? is there any method or hack for achieving this ?