Router loses parameters
See original GitHub issueI’m submitting a … (check one with “x”)
[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior By clicking on an RouterLink the URL will be updated but the params of ActivatedRoute.params stay empty.
Example:
this.route.params.subscribe(params => { params are empty even if the url contains params });
Expected/desired behavior The ActivatedRoute Observer should submit all params from the url.
Please tell us about your environment:
- Angular version: 2.0.0-rc.6
- Router version: 3.0.0-rc.2
- Browser: [Chrome52]
- Language: [TypeScript]
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Angular 6 router loses route params - Stack Overflow
Given a main app, and lazy loaded module, I can access domain/base/name successfully, but all the recommended ways to access the route parameter...
Read more >Router loses query params after push() with a dynamic route
I think I have found a router regression. When calling router.push with a dynamic route, any query string values are lost on the...
Read more >Understand Routing in Vue.js With Examples | by SaidHayani
The $router method takes two parameters, first the name of the component, we want to navigate and the second parameter is the the...
Read more >Parameterised Routes • Angular - codecraft.tv
With parameterised routes we can support variable paths in our routes. Angular also supports optional routes via passing in an object to the...
Read more >Accessing Route Parameters with ActivatedRoute vs ...
If you have defined your route paths in app-routing.module.ts, ... For example, Your data will be lost after the page is refreshed.
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
Had this issue before. You can still access the params from other component which is not a direct child component by below method:
this.route.pathFromRoot.forEach((route) => route.params.subscribe((params) => console.log(params));
@jneveux I guess this is the whole idea behind it, to provide route params only in active component. I do not get the concept yet and it bothers me as well, having anuglar-ui router experience. Maybe someone can elaborate?