Parser Error: Got interpolation ({{}}) where expression was expected

我是研究僧i 提交于 2019-11-28 13:17:43

You can't use interpolation inside standart property binding. There should be expression.

Seems it should be:

[attr.aria-labelledby]="'desiredSkill' + $index"

or

attr.aria-labelledby="desiredSkill{{$index}}"
Yogesh Aggarwal

Usually this error occurs when we are trying to implement both Interpolation and Property data binding on the same html property.

Example:

Wrong implementation

[disabled]= {{isDisabled}}

Correct implementation

disabled= {{isDisabled}}

Note: remove the square bracket from the html element property

I think you forgot to declare index of ngFor

*ngFor="let item of ['Elastic Search','Database Theory','CVS'];let $index=index" ...

also use,

[attr.aria-labelledby]="desiredSkill{{$index}}"

Use this

  <button class="btn btn-primary" title="Edit" (click)="showEditModal(record.id)"><i class="fa fa-edit"></i></button>

In link tags use like this

Use this

<a  class="custom-badge status-blue" [routerLink]="'/hospital/doctorleave/'+item.Id]">Manage Leave</a> 

Instead of

<a  class="custom-badge status-blue" [routerLink]="'/hospital/doctorleave/{{item.Id}}']">Manage Leave</a> 
DINESH Adhikari

If you want pass only $index value

[attr.aria-labelledby]=" ' ' + $index"
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!