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
{{ message }}
Repository navigation
Router: CanDeactivate doesn't provide future RouterState snapshot #10186
[x] bug report
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior
When using the CanDeactivate guard, the RouterStateSnapshot is a snapshot of the current state.
Expected/desired behavior
The RouterStateSnapshot in the canDeactivate(component, route, state) should provide the state as the future RouterState.
Note the console logs destination url: /away from the RouterStateSnapshot.url
What is the expected behavior?
The console logs destination url: / from the RouterStateSnapshot.url
What is the motivation / use case for changing the behavior?
To provide some context as to the proposed destination URL and other information. The current RouterState is already available through the Router service
Please tell us about your environment:
Angular version: 2.0.0-rc.X
Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
Activity
zoechi commentedon Jul 20, 2016
like #9853 ?
brandonroberts commentedon Jul 20, 2016
Yea, I'm not proposing adding another argument to the method though. I'll leave a comment there
angular-automatic-lock-bot commentedon Sep 9, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.