After my webservice completes data retrieval, I trigger
$rootScope.$emit('driver-loader');
. This signal is only sent from this particular location. In order to listen for 'driver-loaded', I have the following code snippet:
var watchDriverLoader = $rootScope.$on('driver-loaded', function(){
console.log('loaded');
watchDriverLoader = null;
});
However, within my controller, the console.log statement sometimes gets executed multiple times, occasionally 4-5 times.