Skip to content

Location now uses PlatformLocation directly for the new getState() api instead of going through LocationStrategy. #34603

@statop

Description

@statop

🐞 bug report

Affected Package

@angular/router

Is this a regression?

yes

Description

Location now uses PlatformLocation directly for the new getState() api instead of going through LocationStrategy.

See https://github.com/angular/angular/blob/8.0.x/packages/common/src/location/location.ts#L95

Prior to version 8 LocationStrategy was the api to implement to customize how the router stored/manipulated the url and state.

Now you must wrap PlatformLocation somehow in addition to providing a LocationStrategy.

This breaks the api contract that was implied.

🔬 Minimal Reproduction

none

🔥 Exception or Error

none

🌍 Your Environment

Angular Version:
7, upgrading to 8

Anything else relevant?

I suggest you add getState to LocationStrategy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4A relatively minor issue that is not relevant to core functionsarea: routerfreq1: lowopen for contributionsAn issue that is suitable for a community contributor (based on its complexity/scope).refactoringIssue that involves refactoring or code-cleanup

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions