Feature request: Router navigateById
See original GitHub issueI’m submitting a…
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Performance issue
[v] 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
[ ] Other... Please describe:
Current behavior
Unable to restore previous history state by NavigationId
Expected behavior
Able to navigate to previous state simply by it’s id.
Will be great to have router method navigateById
What is the motivation / use case for changing the behavior?
You added id
to router.events, to determine states history.
You added restoredState to NavigationStart to determine restoration of previous router states.
But, there is no option to navigate by this id.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Send data through routing paths in Angular - Stack Overflow
Best I found on internet for this is ngx-navigation-with-data. It is very simple and good for navigation the data from one component to...
Read more >Common Routing Tasks - Angular
The last route with the path of ** is a wildcard route. The router selects this route if the requested URL doesn't match...
Read more >Router navigate - option to trigger params subscription on ...
I have a parent and child routing configuration, where child is loaded based on the id required parameter of it's parent. ... I...
Read more >Using Route Parameters - Rangle.io : Angular Training
The reason that the params property on ActivatedRoute is an Observable is that the router may not recreate the component when navigating to...
Read more >9 Interesting Ways to Pass Data through Angular RouterState.
RouterState represents the state of the router as it keeps changing over time when users navigate from page to page. In this article,...
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
@glebmachine It’s still possible to do it yourself. I know because I’ve done that before, sadly I cannot share code. You would need to provide your own
LocationStrategy
, keep a stack with navigation ids which would be manipulated accordingly on pushState/replaceState/popState/NavigationEnd (really tricky to do it right) and usewindow.history.go
- the stack will provide information how far You want to go.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.