question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[labs/router] Make the current route field public

See original GitHub issue

At 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:open
  • Created 2 years ago
  • Reactions:6
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
steve2507commented, Sep 25, 2022

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 the currentRoute would simply be exposed on the router. Another option would be to fire an event whenever goto is called, containing the currentRoute as one of the event detail. Having both would be perfect.

0reactions
zandaqocommented, Sep 5, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to get current route custom data in angular 2?
I have set up routes is like below
Read more >
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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found