Andrew Scott
8a56c99f87
docs(router): Update router guide to use UrlTree for guard redirects (#37100)
The current implementation for redirecting users inside guards was in place before the feature was added to allow `CanActivate` and `CanActivateChild` guards to return `UrlTree` for redirecting users. Returning `UrlTree` should be the default method, as it provides a more desirable redirecting experience. When using `router.navigate` followed by `return false`, the `Router` calls `resetUrlToCurrentUrlTree` (in the `finalize` operator) before processing the navigation to the new route. This can result in an undesirable history if the navigation was the first navigation in the application - that is, the route will briefly be reset to just `/` (see #36187). Fixes #36187 PR Close #37100
Angular
Angular is a development platform for building mobile and desktop web applications using TypeScript/JavaScript and other languages.
Quickstart
Changelog
Learn about the latest improvements.
Want to help?
Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for contributing and then check out one of our issues in the hotlist: community-help.
Description
Languages
TypeScript
68.6%
HTML
12.8%
JavaScript
8.4%
Pug
7%
Starlark
1.4%
Other
1.7%