i have $rootScope.$emit('setReturnedlast');
in a service and in a controller:
$rootScope.$on('setReturnedlast', function() {
alert('test');
$scope.returnedLast = true;
});
but its doesnt fire, what can it be? i am making this because i wait for many promises but this is a fnction that goes async downloading files so it finishes very last and i need to know when for getting rid of a preloader.