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.

Provide routing details in router events

See original GitHub issue

I’m submitting a…


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[X] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

Router#events do not contain information on whether skipLocationChange or replaceUrl have been provided.

Expected behavior

Events such as NavigationEnd should contain these flags.

What is the motivation / use case for changing the behavior?

This would be useful, e.g,. to track navigation events to build an internal history stack which can be used to implement a »back button« in the app. However, there may be components within a page that change the URL but are used with replaceUrl to prevent adding to the location history. In the router events, however, it is not possible to see whether these flags have been provided.

I also don’t want to use Location#back because I’d like to provide an actual routerLink instead of a click handler such that the link is actually a proper link.

Environment


Angular version: 5.x

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jasonadencommented, Feb 13, 2018

Thanks for this issue. I can definitely see how this would be useful. Is this something you would like to create a PR for?

0reactions
angular-automatic-lock-bot[bot]commented, Nov 9, 2020

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Event - @angular/router
Router events that allow you to track the lifecycle of the router. See more... type Event = RouterEvent | NavigationStart | NavigationEnd |...
Read more >
Angular Router Events - TekTutorialsHub
The Angular Router raises events when it navigates from one route to another route. It raises several events such as NavigationStart , NavigationEnd ......
Read more >
Angular Routing Events and debugging - Medium
When we navigate through router by routerLink, navigateByUrl() or navigate() , each time Angular Router emit events for each phase of navigation ...
Read more >
What are Router Events in Angular? - HackerNoon
An event triggered when routes are recognized. class RoutesRecognized extends RouterEvent { constructor(id: number, url: string, ...
Read more >
Angular 2 router event listener - Stack Overflow
The angular 2 router events has different classes, and what gets passed to the subscription from the router.events ...
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