angular/packages/router
Andrew Scott 286b2807de fix(router): eagerly update internal state on browser-triggered navigations (#43102)
The management of `browserUrlTree` currently has several problems with
correctly tracking the actual state of the browser.

This change makes the Router eagerly update the `browserUrlTree` when
handling navigations triggered by browser events (i.e., not 'imperative'). This
is because with those types of navigations, the browser URL bar is
_already_ updated. If we do not update the internal tracking of the
`browserUrlTree`, we will be out of sync with the real URL if the
navigation is rejected.

It would be best if we could remove `browserUrlTree` completely, but doing that
would require a lot more investigation and is blocked by #27059 because
the SpyLocation used in tests does not emulate real browser behavior.

fixes #43101

PR Close #43102
2021-08-16 09:33:23 -07:00
..
scripts refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
src fix(router): eagerly update internal state on browser-triggered navigations (#43102) 2021-08-16 09:33:23 -07:00
test fix(router): eagerly update internal state on browser-triggered navigations (#43102) 2021-08-16 09:33:23 -07:00
testing feat(router): ability to provide custom route reuse strategy via DI for RouterTestingModule (#42434) 2021-07-26 12:02:42 -07:00
upgrade build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
.gitignore refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
BUILD.bazel build: use api-golden tool from dev-infra for testing public API (#42688) 2021-06-30 11:43:48 -07:00
index.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
karma-test-shim.js build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
karma.conf.js build: rename shims_for_IE.js -> shims_for_internal_tests.js (#43002) 2021-08-02 10:38:42 -07:00
package.json refactor(core): update peerDependencies to allow rxjs7 (#42991) 2021-08-02 13:55:01 -07:00
PACKAGE.md docs: add package doc files (#26047) 2018-10-05 15:42:14 -07:00
public_api.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
README.md docs(router): remove obsolete sections in README.md (#27880) 2019-01-11 11:15:59 -08:00

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.