angular-docs-cn/packages/router/src
Alison Gale f6667f8281 fix(router): adjust UrlTree redirect to replace URL if in eager update (#32988)
Resubmit #31168 now that google3 tests can pass. This requires http://cl/272696717 to be patched.
Original description from jasonaden:

Without this change when using UrlTree redirects in urlUpdateStrategy="eager", the URL would get
updated to the target location, then redirected. This resulted in having an additional entry in the
history and thus the back button would be broken (going back would land on the URL causing a new
redirect).

Additionally, there was a bug where the redirect, even without urlUpdateStrategy="eager", could
create a history with too many entries. This was due to kicking off a new navigation within the
navigation cancelling logic. With this PR the new navigation is pushed to the next tick with a
setTimeout, allowing the page being redirected from to be cancelled before starting a new
navigation.

Related to #27148

fix(router): adjust UrlTree redirect to replace URL if in eager update

Fix lint errors

PR Close #32988
2019-10-18 14:42:21 -04:00
..
components build: enable bundle_dts for router package (#28833) 2019-03-07 07:30:44 -08:00
directives docs: clarify static router-outlet name attribute (#32973) 2019-10-14 23:47:01 +00:00
operators fix(router): add `relativeLinkResolution` to `recognize` operator (#26990) 2018-11-13 16:18:08 -08:00
utils refactor(router): compatibility with typescript strict flag (#30993) 2019-07-18 14:21:26 -07:00
apply_redirects.ts feat(router): allow guards to return UrlTree as well as boolean (#26521) 2018-10-31 19:51:50 -04:00
config.ts docs: change "patchMatch" to "pathMatch" (#32935) 2019-10-18 11:31:53 -04:00
create_router_state.ts fix(router): cache route handle if found (#22475) 2018-04-23 13:35:59 -07:00
create_url_tree.ts Revert "fix(router): change processing url tree children condition (#26243)" (#27516) 2018-12-06 09:17:20 -08:00
events.ts docs: add detail to router event doc (#32140) 2019-08-27 16:17:06 -07:00
index.ts docs(router): make `InitialNavigation` part of the public API (#32707) 2019-09-27 14:21:13 -07:00
interfaces.ts docs(router): Update description and example for Resolve interface (#31810) 2019-10-10 15:28:03 -07:00
private_export.ts build: enable bundle_dts for router package (#28833) 2019-03-07 07:30:44 -08:00
recognize.ts Revert "fix(router): process empty path segment when preceding a named outlet (#26243)" (#27516) 2018-12-06 09:17:20 -08:00
route_reuse_strategy.ts docs: convert all `@experimental` tags to `@publicApi` tags (#26595) 2018-10-19 14:35:52 -07:00
router.ts fix(router): adjust UrlTree redirect to replace URL if in eager update (#32988) 2019-10-18 14:42:21 -04:00
router_config_loader.ts docs: clean up router api doc (#31476) 2019-07-18 10:33:17 -07:00
router_module.ts docs(router): make `InitialNavigation` part of the public API (#32707) 2019-09-27 14:21:13 -07:00
router_outlet_context.ts docs: update router to use `@publicApi` tags (#26595) 2018-10-19 14:35:53 -07:00
router_preloader.ts docs: update router to use `@publicApi` tags (#26595) 2018-10-19 14:35:53 -07:00
router_scroller.ts fix(router): default scroll position restoration to disabled (#25586) 2018-08-21 10:48:14 -07:00
router_state.ts refactor(docs-infra): remove `linenums=false` since it is now the default (#31674) 2019-07-24 14:38:54 -07:00
shared.ts docs: clean up router api doc (#31476) 2019-07-18 10:33:17 -07:00
url_handling_strategy.ts docs: convert all `@experimental` tags to `@publicApi` tags (#26595) 2018-10-19 14:35:52 -07:00
url_tree.ts docs: update router to use `@publicApi` tags (#26595) 2018-10-19 14:35:53 -07:00
version.ts docs: update router to use `@publicApi` tags (#26595) 2018-10-19 14:35:53 -07:00