-
-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to redirect with params #483
Comments
I agree, this would be a great feature. Any interest in working on a contribution to add it? |
@EisenbergEffect sure- is there an approach you would recommend? My initial thought was that parsing / replacing params in the section I listed would make sense, but a) want to make sure that is correct and b) is there something that is designed to do this already that I should reuse instead of writing regex to replace by :param/ with ${param}/ ? Finally, what are the requirements for getting a PR accepted? I am going to try to do this over the weekend and want to do it right the first time. |
There are some existing APIs to help you out. You shouldn't need to mess with RegEx. Have a look at what happens with the basic route and you should be able to emulate the same thing. |
@nym I'm interested in creating a PR for this, if you'd need help |
allow redirect fragments to contain token parameter this closes feature request aurelia#483
allow redirect to contain token parameters for router config this closes feature request aurelia#483
Can be closed |
I'm submitting a feature request
Redirecting with parameters does not work in the same way that directing with query parameters do.
Given:
{route: "path/to/:id/old", redirect: "path/to/:id/new"}
Expected:
/path/to/9000/old ->
/path/to/9000/new
Actual:
/path/to/9000/old ->
/path/to/:id/new
From the source, it appears that query parameters are passed along as part of redirectLocation, but parameters are not being replaced despite being available in instruction.params.
router/src/navigation-plan.js
Line 28 in 90b1183
The text was updated successfully, but these errors were encountered: