Skip to content

Support browserUrl from NavigationBehaviorOptions in RouterLink #66805

@itotallyrock

Description

@itotallyrock

Which @angular/* package(s) are relevant/related to the feature request?

router

Description

NavigationBehaviorOptions had browserUrl added here in #53318 which is a useful feature for controlling the URL experience a user has. It would be nice if this same option was forwarded to the RouterLink directive which already supports a subset of the NavigationBehaviorOptions.

Proposed solution

Provide a new input for browserUrl that is provided to the extras used when calling router.navigateByUrl via the RouterLink directive.

Alternatives considered

  • A custom (click) handler calling router.navigateByUrl
    • This negates the utility provided by the RouterLink in the first place.
  • Duplicate routes matching the desired browser URLs and use skipLocationChange or replaceUrl
    • Duplicating route definitions feels like a hack rather than a solution to this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: routerhelp wantedAn issue that is suitable for a community contributor (based on its complexity/scope).

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions