I have the following "broadcast" inside a "directive":
console.log('a emitir...');
$rootScope.$broadcast('olamundo', params);
In my controller I have the following code:
$scope.$on('olamundo', function (event, args) {
console.log('a escutar...');
//aqui vai o código
});
My "olamundo" event is running 2 times, the phrase "listening ..." appears twice in the console (due to "console.log" in the code above). In the "directive" where the "broadcast" is issued, the phrase 'to issue ...' appears feathers once. Is there no other broadcast with the same name, because the 'olamundo' event is running 2 times?