Skip to content

feat(router-link): Accept UrlTree as input #34468

@samuelfernandez

Description

@samuelfernandez

🚀 feat(router-link): Accept UrlTree as input

Relevant Package

This feature request is for @angular/router

Description

Currently [routerLink] directive accepts either an array of commands or a string. Since angular uses UrlTree as a model to store urls, it'd be great to extend this directive so that in addition it accepts a UrlTree.

Describe the solution you'd like

Let [routerLink] input accept commands: any[]|string|UrlTree.

Describe alternatives you've considered

  • A different directive for this purpose. But having already a directive for that it'd be great to just extend the API.
  • A pipe that converts a UrlTree into a string. The problem is that the params that a UrlTree might include should be extracted and put in their respective inputs. So that doesn't play nicely with all the features UrlTree have.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: routerfeatureIssue that requests a new featurefeature: under considerationFeature request for which voting has completed and the request is now under considerationfreq1: low

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions