routerLink adding question mark in url?
Asked Answered
L

1

6

I want to have route something like this : www.test.com?procesId=12 .

This is my current routerLink:

But right now i get this value :

www.test.com/123

Any suggestion how can i add in url ?procesId = 12 with routerLink ?

I tried:

But i dont get question mark in url and also i get an error:

Cannot match any routes.

I know that i can get question mark when i use params but i want to use it with routerLink, because thats the way they use it on this project.

Lung answered 20/7, 2017 at 7:21 Comment(0)
U
16

you can use query params in routerlink like below

[routerLink]="['']" [queryParams]="{ procesId : 12 }"
Upstanding answered 20/7, 2017 at 7:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.