How to abort a return from a rxjs call to backend, when the user navigate to another page before the result returns?
In example below, it shows the alert message even if another page is already loaded.
this.http.get('api/searchforanything', {
params: {
data: this.dateService.toLocalISOString(data)
}
}).subscribe(x => {
alert("I am back!");
this.chartLabels = x.meses;
this.data = x.valores;
this.isLoading = false;
});