Angular Routerlink : Concatenate Parent Route String with Variable

3.4k views Asked by At

How do I add string interpolation/concatenation

to router link below which goes to parent route, and then variable link?

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

There are 1 answers

0
Muni Kumar Gundu On BEST ANSWER

String Interpolation

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

Attribute Binding Syntax:

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

or

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