簡體   English   中英

Angular Routerlink:將父路由字符串與變量連接起來

[英]Angular Routerlink : Concatenate Parent Route String with Variable

如何添加字符串插值/串聯

到下面的路由器鏈接,然后轉到父路由,然后是可變鏈接?

 <a routerLink="../account-information/" + "item.productId">

字符串插值

routerLink="../account-information/{{item.productId}}"

屬性綁定語法:

[routerLink]="'../account-information/' +item.productId" 

或者

[routerLink]="['../account-information/', item.productId]"

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM