如何在routerlink角4中传递queryparams

时间:2018-07-18 21:41:24

标签: angular query-parameters routerlink

我正在将routerLink与在锚标记<a>中发送到服务的参数一起使用。 下面是我的锚标签

<a [routerLink]="['/controllerTest/test/']" [queryParams]="{itemVal:item.val}"> </a>

我的应用程序网址为http://localhost:4200/appName/#/

appName是运行我的服务的地方。

单击<a>标记中的值时,我看到URL更改为http://localhost:4200/#/?itemVal=021而不是http://localhost:4200/appName#/controllerTest?itemVal=021

0 个答案:

没有答案