X Tutup
Skip to content

Router: link urls doesn't have query string parameters #7367

@alexpods

Description

@alexpods

Copy of @zanettin's issue from angular/router#397

When I click on a routerLink

LINK:

<a [routerLink]=" ['./RouteParamsTest', { userId : '1919', lang : 'it', token : 'jwt' }] ">Route Params Test 2</a>

CONFIG:

{ path: '/route-params-test/:userId/:lang', component: RouteParamsTest, name: 'RouteParamsTest' }

with disabled JS, this URL gets called => http://localhost:3000/route-params-test/1919/it and the query string won't appear. With activated JS everything works as expected.

The reason of the problem is here. As you can see urlParams are used only in _stringifyMatrixParams() which is called only if we have auxInstructions (see here). So if we don't have auxilary routes then urlParams will never be used. (toLinkUrl() is called here to update href of the link)

@matsko @btford @IgorMinar

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup