Please sign in to comment.
feat(common): add ability to retrieve the state from Location service (…
…#30055) Previously there wasn't a way to retrieve `history.state` from the `Location` service. The only time the framework exposed this value was in navigation events. This meant if you weren't using the Angular router, there wasn't a way to get access to this `history.state` value other than going directly to the DOM. This PR adds an API to retrieve the value of `history.state`. This will be useful and needed to provide a backwards-compatible `Location` service that can emulate AngularJS's `$location` service since we will need to be able to read the state data in order to produce AngularJS location transition events. This feature will additionally be useful to any application that wants to access state data through Angular rather than going directly to the DOM APIs. PR Close #30055
- Loading branch information...
Showing with 81 additions and 5 deletions.
- +10 −1 packages/common/src/location/location.ts
- +1 −0 packages/common/src/location/platform_location.ts
- +1 −0 packages/common/test/BUILD.bazel
- +41 −1 packages/common/test/location/location_spec.ts
- +3 −3 packages/common/testing/src/location_mock.ts
- +10 −0 packages/common/testing/src/mock_location_strategy.ts
- +2 −0 packages/platform-browser/src/browser/location/browser_platform_location.ts
- +3 −0 packages/platform-server/src/location.ts
- +3 −0 packages/platform-webworker/src/web_workers/worker/platform_location.ts
- +5 −0 tools/public_api_guard/common/common.d.ts
- +2 −0 tools/public_api_guard/common/testing.d.ts