angular-cn/packages/router
Jason Aden 15e397816f fix(router): adjust UrlTree redirect to replace URL if in eager update (#31168)
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

PR Close #31168
2019-06-27 15:54:20 -07:00
..
scripts refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
src fix(router): adjust UrlTree redirect to replace URL if in eager update (#31168) 2019-06-27 15:54:20 -07:00
test fix(router): adjust UrlTree redirect to replace URL if in eager update (#31168) 2019-06-27 15:54:20 -07:00
testing build: remove unreferenced tsconfig-build.json files (#30858) 2019-06-05 09:03:36 -07:00
upgrade build: remove unreferenced tsconfig-build.json files (#30858) 2019-06-05 09:03:36 -07:00
.gitignore refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
BUILD.bazel build: convert entry_point to label (#30627) 2019-06-11 00:03:11 +00:00
PACKAGE.md docs: add package doc files (#26047) 2018-10-05 15:42:14 -07:00
README.md docs(router): remove obsolete sections in README.md (#27880) 2019-01-11 11:15:59 -08:00
index.ts refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
karma-test-shim.js test(ivy): run router tests with ivy on CI (#27195) 2018-11-21 09:19:40 -08:00
karma.conf.js test(ivy): run router tests with ivy on CI (#27195) 2018-11-21 09:19:40 -08:00
package.json build: update rxjs version requirements to 6.4.0 (#30032) 2019-04-22 11:15:33 -07:00
public_api.ts build: publish tree of files rather than FESMs (#18541) 2017-08-31 15:34:50 -07:00

README.md

Angular Router

Managing state transitions is one of the hardest parts of building applications. This is especially true on the web, where you also need to ensure that the state is reflected in the URL. In addition, we often want to split applications into multiple bundles and load them on demand. Doing this transparently isnt trivial.

The Angular router is designed to solve these problems. Using the router, you can declaratively specify application state, manage state transitions while taking care of the URL, and load components on demand.

Guide

Read the dev guide here.