Rijo
Rijo

Reputation: 3043

How to bind the the value in Angular

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

Upvotes: 1

Views: 58

Answers (1)

Mahdi Zarei
Mahdi Zarei

Reputation: 7396

Use this syntax:

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

Upvotes: 1

Related Questions