angular-docs-cn/packages/common
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
..
http fix(common): temporarily re-export and deprecate `XhrFactory` (#41393) 2021-04-01 11:26:11 -07:00
locales build: update .bazelversion (#40579) 2021-01-26 11:35:54 -08:00
src feat(common): add `historyGo` method to `Location` service (#38890) 2021-04-06 09:25:58 -07:00
test feat(common): add `historyGo` method to `Location` service (#38890) 2021-04-06 09:25:58 -07:00
testing feat(common): add `historyGo` method to `Location` service (#38890) 2021-04-06 09:25:58 -07:00
upgrade docs: update links to use HTTPS as protocol (#39718) 2020-11-20 12:52:16 -08:00
BUILD.bazel build: provide full paths to `ts_api_guardian_test_npm_package` and `ts_api_guardian_test` (#36034) 2020-03-12 09:49:00 -07:00
PACKAGE.md docs: add api doc to sub-packages (#33801) 2019-11-20 14:48:50 -08:00
index.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
package.json feat(core): support TypeScript 4.2 (#41158) 2021-03-17 09:10:25 -07:00
public_api.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00