I start a timer in an Angular 2 component which is inside a router outlet.
setInterval(() => { ... }, 10000);
When I leave the route
This should do it:
routerOnActivate() { this.timer = setInterval(()=>{ ... }, 10000); } routerOnDeactivate() { clearInterval(this.timer); }