$scope.$on("stopSpinner", function() {
$('body').mask('hide');
});
the above code works that when stopSPinner is event is recieved, it executes. But my requirement is little more involved. I want to wait for two different events to recive before executing a function. Order of events could be different but i want to function to only execute once both events have occured. how can this be achived