Home > database >  How to bind the the value in Angular
How to bind the the value in Angular

Time:01-05

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';

CodePudding user response:

Use this syntax:

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