I would like to notify multiple controllers of external changes from a service. I know that i can do this by using a deferred object and calling notify on it and registering a callback on that.
e.g
// in service
$timeout(function() {
defered.notify('In progress')}
, 0)
//in controller
var promise = myService.promise
promise.then(function(success) {
console.log("success");
}, function(error) {
console.log("error");
}, function(update) {
console.log("got an update!");
}) ;
Is there a way to remove my notify callback when the controller is destroyed?