feat(router-link): Accept UrlTree as input
See original GitHub issueš 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
UrlTreeinto a string. The problem is that the params that aUrlTreemight include should be extracted and put in their respective inputs. So that doesnāt play nicely with all the featuresUrlTreehave.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:35
- Comments:5 (2 by maintainers)
Top Results From Across the Web
RouterLink - Angular
The input that you provide to the link is treated as a delta to the current URL. For instance, suppose the current URL...
Read more >How to pass a parameter to routerLink that is somewhere ...
In your particular example you'd do the following routerLink : [routerLink]="['user', user.id, 'details']". To do so in a controller, you can inject RouterĀ ......
Read more >In-app navigation: routing to views - Angular
To handle the navigation from one view to the next, you use the Angular router. The router enables navigation by interpreting a browser...
Read more >@angular/router-deprecated | Yarn - Package Manager
CanLoad guards in the Router are deprecated. Use CanMatch instead. compiler-cli. Commit, Type, Description. 7d88700933, fix, accept inheriting the constructorĀ ...
Read more >Strapi v4 Authentication and Authorization with Angular 13 on ...
isLoggedIn">Sign Up</button> <button routerLink="/auth/login" type="button" ... To make the TitleComponent inputs take undefined values,Ā ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.
Find more details about Angularās feature request process in our documentation.
Is there any way to pass this ā/route?query=stringā to routerLink without a serialization?
[routerLink]=ā[ā/route?query=stringā]ā will return ā/route%3Fquery%3Dstringā
Not very convenient