Skip to content

route redirectTo not preserving query params #13315

@mdsauer

Description

@mdsauer

I'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
Prior to release 2.3 query parameters were preserved through a configured route redirectTo. This is no longer working in 2.3. Is this an expected breaking change or was the prior behavior not correct?

Expected behavior
Query params preserved on a redirectTo, or at least allow it to be configured to do so.

Minimal reproduction of the problem with instructions
{ path: '',
redirectTo: '/component1',
pathMatch: 'full'
},
{ path: 'component1',
component: Component1
},

In Component1:
ngOnInit(): void {
let params = this.route.snapshot.queryParams; //route is ActivatedRoute

Prior to 2.3 params passed in url as /?param1=val1&param2=val2 would be available to Component1

Please tell us about your environment:
Windows 7, VS Code

  • Angular version: 2.3

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
    Chrome, IE11

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: routerneeds reproductionThis issue needs a reproduction in order for the team to investigate further

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions