You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Angular 4 canDeactivate fails if the back button is hit twice in a row
The text was updated successfully, but these errors were encountered:
aneeskodappana
changed the title
Angular 4 canDeactivate fails if the back button is hit twice in a row
Angular canDeactivate fails if the back button is hit twice in a row
Nov 21, 2019
resolved manually using this way. any other recommended way link
canDeactivate(component: CanComponentDeactivate,currentRoute: ActivatedRouteSnapshot){constconfirmation=window.confirm('Is it OK?');if(!confirmation){constcurrentUrlTree=this.router.createUrlTree([],currentRoute);constcurrentUrl=currentUrlTree.toString();this.location.go(currentUrl);}returnof(confirmation);}
I am attempting to implement a back button guard in Angular 8. I am trying to use a service and canDeactivate.
馃悶 bug report
Affected Package
"@angular/core": "~8.2.2",
"@angular/router": "~8.2.2",
Is this a regression?
yes
Description
Angular 8 canDeactivate fails if the back button is hit twice in a row
馃敩 Minimal Reproduction
馃敟 Exception or Error
Not an error
馃實 Your Environment
Angular Version:
Angular 4 canDeactivate fails if the back button is hit twice in a row
The text was updated successfully, but these errors were encountered: