-
Notifications
You must be signed in to change notification settings - Fork 27k
Redirect if a guard returns a UrlTree #26521
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
Redirect if a guard returns a UrlTree #26521
Conversation
|
You can preview ef48f54 at https://pr26521-ef48f54.ngbuilds.io/. |
benlesh
left a comment
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.
Only one small change I'd make.
packages/router/test/router.spec.ts
Outdated
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.
RxJS core team recommends using an Observer for all subscriptions that use more than one callback, like:
obs.subscribe({
next(value) { },
error(err) { }
});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.
OOC, why?
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.
Convention and more readable.
|
You can preview a1f41fc at https://pr26521-a1f41fc.ngbuilds.io/. |
a1f41fc to
94328f9
Compare
|
You can preview 94328f9 at https://pr26521-94328f9.ngbuilds.io/. |
* Improve type checking within the CheckGuards function * Change public API to allow returning of UrlTree instead of boolean
* Removed `andObservable` helper function in favor of inline implementation * Flow `boolean | UrlTree` through guards check * Add tests to verify behavior of `checkGuards` function flowing `UrlTree` properly
…redirects Fixes angular#24618 FW-153 #resolve
94328f9 to
1cb4a3b
Compare
sarunint
left a comment
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.
Great feature!
|
You can preview eeeb56b at https://pr26521-eeeb56b.ngbuilds.io/. |
eeeb56b to
43e34dc
Compare
|
You can preview 43e34dc at https://pr26521-43e34dc.ngbuilds.io/. |
43e34dc to
43e505e
Compare
* Improve type checking within the CheckGuards function * Change public API to allow returning of UrlTree instead of boolean PR Close #26521
* Removed `andObservable` helper function in favor of inline implementation * Flow `boolean | UrlTree` through guards check * Add tests to verify behavior of `checkGuards` function flowing `UrlTree` properly PR Close #26521
|
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. |
Fixes #24618