Router: there is no way to redirectTo passing along query string params to the target route.
See original GitHub issueI’m submitting a …
[ ] bug report
[X] feature request
[ ] support request
Current behavior There is no way to configure a route redirectTo another route passing query string params to the target route.
Expected/desired behavior Perhaps something like this?
{
path: '**',
redirectTo: '/list?param=true',
terminal: true
}
This will currently fail with EXCEPTION: Error: Uncaught (in promise): Error: Cannot match any routes: 'list?param=true'
Reproduction of the problem
This plunker illustrates the issue, see app.app-routes.rs
http://plnkr.co/edit/KHEWJhMBlZviHrZVqbDS?p=preview
devtools will log the error. If we just remove ?param=true
from the redirectTo
, it all works well.
What is the expected behavior?
I would expect the catch all route to redirect to /list passing along the param=true
parameter, as specified in the redirect. If the redirectTo
cannot accept URLs, then perhaps we could have another parameter to the route config to allow passing in query params?
Please tell us about your environment:
- Angular version: 2.0.0-rc.4
- Browser: all
- Language: TypeScript 1.8.10
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:9 (4 by maintainers)
It only works with absolute routes that contain ‘/’ on the redirect. Could it be possible to implement it so that we could use something like
redirectTo: 'list?param=true'
?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.