I have two controllers. a page called page1 and another called page2. on page1 I have a code that runs an animation.I have a function that calls itself infinitely. in this line. .each(‘end’, tick) when the animation ends, it start tick() again. function tick(){ console.log("hello"); . . . //line 190 paths.attr('transform', null) .transition() .duration(duration) .ease('linear') .attr('transform', 'translate(' + x(now - (limit - 1) * duration) + ')') .each('end', tick) //when the transition ends, it start tick() again } This is fine, because it is an infinite animation. I put console.log(“hello”) in the tick function, then every time this function is executed, the word “hello” is written to the console. so far so good !. when I change the controller, ie when I click to go to page2, my previous animation is still running, and I can still see the console.log(“hello”) of the function that is in my first controller. ...