I am facing problem while working with timer in angular 6. I am not able to unsubscribe timer after certain meet condition.
this.testInterval=interval(1000).pipe(
map(x => this.testSecTime )
).subscribe(x => this.reduceTimer());
I am facing problem while working with timer in angular 6. I am not able to unsubscribe timer after certain meet condition.
this.testInterval=interval(1000).pipe(
map(x => this.testSecTime )
).subscribe(x => this.reduceTimer());
use unsubscribe
for this.
if page destoy
ngOnDestroy() {
this.testInterval.unsubscribe()
}
OR
for any condition
this.testInterval.unsubscribe()