-
Notifications
You must be signed in to change notification settings - Fork 25.8k
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
fix(router): canLoad should cancel a navigation instead of failing it #11001
fix(router): canLoad should cancel a navigation instead of failing it #11001
Conversation
this addresses part of the concern in #10585 |
@@ -22,3 +22,12 @@ export const PRIMARY_OUTLET = 'primary'; | |||
export type Params = { | |||
[key: string]: any | |||
}; | |||
|
|||
export class ErrorCancelingNavigation extends Error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NavigationCancelingError sounds like a better name
public api spec needs to be updated |
12c5c3e
to
786487f
Compare
I'm still receiving this error when returning false from canLoad. Is this related?
Returning false in canLoad should not return an error. |
Can you please file a new issue with a reproduction? thanks
…On Fri, Dec 15, 2017 at 10:17 AM Jason Yeomans ***@***.***> wrote:
I'm still receiving this error when returning false from canLoad. Is this
related?
Uncaught (in promise) Error: NavigationCancelingError: Cannot load children because the guard of the route "path: ''" returned false
Returning false in canLoad should not return an error.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#11001 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AANM6Ev0fgcQpUBXRzwDH6dx0cMf3Kgmks5tAreggaJpZM4JqtZZ>
.
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Currently canLoad returning false fails a navigation instead of canceling it. This is different from canActivate.
This PR changes it so canLoad behaves similar to canActivate.