I use the following code for timer:
export class TimerService { private ticks: number = 0; private seconds: number = 0; private timer; constructor(s
The best way is to unsubscribe when instance is destroyed.
ngOnDestroy() { this.sub.unsubscribe(); }