-
-
Notifications
You must be signed in to change notification settings - Fork 114
Open
Description
I'm submitting a bug report
- Library Version:
1.5.0
Please tell us about your environment:
-
Operating System:
Windows 10 -
Node Version:
14.6.0
- NPM Version:
6.14.8
- JSPM OR Webpack AND Version
webpack 4
-
Browser:
all -
Language:
all
Current behavior:
The following route configuration does not propagate the query string to the redirected route:
const routes: RouteConfig[] = [
{ route: "does-not-work", redirect: "/dashboard?autoselect=true"; },
{ route: "does-work", navigationStrategy: instruction => { instruction.config.redirect = "/dashboard"; instruction.queryString = "autoselect=true"; } },
{ route: "dashboard", name: "dashboard", moduleId: PLATFORM.moduleName("./dashboard") }
];
Expected/desired behavior:
- What is the expected behavior?
The route "does-not-work" should have the behavior of "does-work".
The issue is related to this code:
Lines 81 to 84 in 9ba6ef3
| let queryString = instruction.queryString; | |
| if (queryString) { | |
| redirectLocation += '?' + queryString; | |
| } |
I believe the behavior should be more like instruction.queryString || redirectInstruction.queryString
- What is the motivation / use case for changing the behavior?
Easier configuration of redirect route
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels