Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling CanActivate/CanDeactivate #211

Closed
swymmwys opened this issue Sep 25, 2018 · 4 comments
Closed

Handling CanActivate/CanDeactivate #211

swymmwys opened this issue Sep 25, 2018 · 4 comments
Labels

Comments

@swymmwys
Copy link

swymmwys commented Sep 25, 2018

Feature Request

- [x] feature request

Repro steps

Use CanActivate/CanDeactivate guards on any route.
Progress bar appears when resolving guard.

Desired functionality

It would be nice to have an ability to define whether you need or don't need to show progress bar while resolving CanActivate/CanDeactivate guards.
It's helpful when user have an unsaved changes and you are showing modal dialog, where he can chose to stay on current page or go to other and discard changes.
For now, when I show modal dialog from CanActivate/CanDeactivate guard, progress bar is shows up, which is unnecessary for that moment.

@MurhafSousli
Copy link
Owner

@swymmwys can you add reproduction?

@swymmwys
Copy link
Author

swymmwys commented Sep 25, 2018

@MurhafSousli please see https://stackblitz.com/edit/angular-candeactivate-8vvebg
On CompnentB we have a canDeactivate guard which delay route change for two seconds.
My idea is to have an ability to configure this behaviour. Because in case if we are showing modal dialog in canDeactivate guard, we don't want to show progress bar until user will click button which perform either a redirect to another page or just close the dialog and user continue to stay on the current page.

@MurhafSousli
Copy link
Owner

MurhafSousli commented Sep 25, 2018

The router feature works when router events emits a NavigationStart
It is nice to have an option to select the router event type that starts the progress

@swymmwys
Copy link
Author

yes, that is I'm talking about.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants