angular-docs-cn/packages/router/test
Ahmed Ayed e05a6f3bb3 feat(common): add `historyGo` method to `Location` service (#38890)
Add new method `historyGo`, that will let
the user navigate to a specific page from session history identified by its
relative position to the current page.

We add some tests to `location_spec.ts` to validate the behavior of the
`historyGo` and `forward` methods.

Add more tests for `location_spec` to test `location.historyGo(0)`, `location.historyGo()`,
`location.historyGo(100)` and `location.historyGo(-100)`. We also add new tests for
`Integration` spec to validate the navigation when we using
`location#historyGo`.

Update the `historyGo` function docs

Note that this was made an optional function in the abstract classes to
avoid a breaking change. Because our location classes use `implements PlatformLocation`
rather than `extends PlatformLocation`, simply adding a default
implementation was not sufficient to make this a non-breaking change.
While we could fix the classes internal to Angular, this would still have been
a breaking change for any external developers who may have followed our
implementations as an example.

PR Close #38890
2021-04-06 09:25:58 -07:00
..
aot_ngsummary_test build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
operators fix(router): update type castings for JSON.parse usage (#40710) 2021-02-09 10:48:43 -08:00
utils build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
BUILD.bazel test(router): fix router test failing on IE (#36742) 2020-04-23 12:13:27 -04:00
apply_redirects.spec.ts fix(router): fix load interaction of navigation and preload strategies (#40389) 2021-02-16 11:28:50 -08:00
bootstrap.spec.ts fix(common): cleanup location change listeners when the root view is removed (#40867) 2021-03-04 13:09:04 -08:00
config.spec.ts refactor(router): Produce error message when canActivate is used with redirectTo (#40067) 2021-01-05 10:09:27 -08:00
create_router_state.spec.ts fix(router): Fix arguments order for call to shouldReuseRoute (#26949) 2020-09-15 11:33:52 -07:00
create_url_tree.spec.ts fix(router): fragment can be null (#37336) 2021-03-22 10:02:39 -07:00
helpers.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
integration.spec.ts feat(common): add `historyGo` method to `Location` service (#38890) 2021-04-06 09:25:58 -07:00
recognize.spec.ts fix(router): Ensure named outlets with empty path parents are recognized (#40029) 2021-01-05 12:43:47 -08:00
regression_integration.spec.ts fix(router): ensure routerLinkActive updates when associated routerLinks change (#38511) 2020-08-18 10:21:49 -07:00
router.spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
router_preloader.spec.ts fix(router): fix load interaction of navigation and preload strategies (#40389) 2021-02-16 11:28:50 -08:00
router_scroller.spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
router_state.spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
shared.spec.ts fix(router): fix error when calling ParamMap.get function (#31599) 2020-06-25 11:57:24 -07:00
spy_ng_module_factory_loader.spec.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
url_serializer.spec.ts fix(router): fragment can be null (#37336) 2021-03-22 10:02:39 -07:00
url_tree.spec.ts feat(router): Add more find-tuned control in `routerLinkActiveOptions` (#40303) 2021-02-24 15:32:05 -08:00