Hi Dhimant,

Http is async, and if the caller gets destroyed, the call will get 
canceled. This is a key feature of Observables.
In both cases, the caller gets thrown away before the results can come in. 
That is the reason you calls are aborted.

A better approach to this would be a ca(de)activate guard 
<https://angular.io/api/router/CanDeactivate>.
There is a sample on how to use this 
<https://angular.io/guide/router#the-sample-application>in the docs

Regards
Sander

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/angular/513915b0-d8ab-43cc-adfe-1fef53dec271%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to