End interval when route changes in Angular 2
<p>I start a timer in an Angular 2 component which is inside a router outlet.</p>

<pre><code>setInterval(() =&gt; {
    ...
}, 10000);
</code></pre>

<p>When I leave the route in which the component is embedded the timer isn't quit. How can I achieve that?</p>