Angular using pipes and index in ngFor

后端 未结 1 464
失恋的感觉
失恋的感觉 2021-01-05 18:09

Angular had many changes in the beta, my issue is that try to use pipes and the index in a ngFor and i get this message:

Parser Error: Unexpected token =

相关标签:
1条回答
  • 2021-01-05 19:07

    try below,

    <div (click)="showComentario(i)" *ngFor="let comment of comentarios | filterSource : selectedSource; index as i" >
      {{comment.comment}}
    </div>
    

    Hope this helps!!

    0 讨论(0)
提交回复
热议问题