[labs/router] Make the current route field public
See original GitHub issueAt the moment, the current route field is protected. Making it public would allow other components to check which route is currently active. A simple accessor akin to Routes#params
would do.
A use case example: navigation panel highlighting the currently active tab depending on the active route.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:6
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Routing - Laravel - The PHP Framework For Web Artisans
Route parameters are injected into route callbacks / controllers based on their order - the names of the route callback / controller arguments...
Read more >Router tutorial: tour of heroes - Angular
In this tutorial, you build upon a basic router configuration to explore features such as child routes, route parameters, lazy load NgModules, guard...
Read more >ASP.NET Core Blazor routing and navigation - Microsoft Learn
Learn how to manage request routing in Blazor apps and how to use the Navigation Manager and NavLink component for navigation.
Read more >Services and Routes - v3.1.x - Kong Docs
In Kong Gateway, a service is an abstraction of an existing upstream ... To view the current state of the example_route route, make...
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 FreeTop 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
Top GitHub Comments
Similar issue here where I am currently resorting to tracking the state myself and updating this state during the
enter()
call. It would be great if thecurrentRoute
would simply be exposed on the router. Another option would be to fire an event whenevergoto
is called, containing the currentRoute as one of the event detail. Having both would be perfect.With
Routes#_currentRoute
becoming private, checking the active route is nigh impossible. Can we have a getter for the current route? It’s just a couple lines of code, if there are no objections, I’m willing to submit a PR.