You can “kill” it using the method unsubscribe()in the lifecycle event OnDestroy, assuming you are using subscriptions, for example:
mySubscription: any;
ngOnInit() {
this.mySubscription = this.myHttpCall().subscribe...
}
ngOnDestroy() {
this.mySubscription.unsubscribe();
}
source
share