Well, I'm going to be here for an interview.
$rootScope.$on("timer", updateApanha());
var arquivoJSON = (JSON.parse(window.sessionStorage.getItem('timeUpdate'))*1000);
console.log(tempoDeAtualizacao);
function updateApanha(){
setInterval(getApanha, tempoDeAtualizacao);
console.log("get Apanha " +tempoDeAtualizacao);
}
The point is that the interval it is set to undefined. And on account of that he is making the requisition all the time. What I wanted was that only when it was called $ on that the interval was set to be able to call the function.