How to bind the the value in Angular

55 Views Asked by At

I have below template, how to bind the defaultRelatedGuideUrl from the controller to the template?

[routerLink]="(editMode || readOnly) ? [] : ['/defaultRelatedGuideUrl/', link.slug]">

Controller:

@Input() defaultRelatedGuideUrl = 'myparam';
1

There are 1 best solutions below

3
On BEST ANSWER

Use this syntax:

[routerLink]="(editMode || readOnly) ? [] : ['', defaultRelatedGuideUrl, link.slug]">