Looping using ngFor and skip nth element

对着背影说爱祢 提交于 2019-11-30 04:17:10

问题


I was wondering if there is a way in angular2 to loop through an array or a list using *ngFor and skip the first or nth element


回答1:


<div *ngFor="let item of items; let i=index">
  <div *ngIf="i != n">{{i}} is not n</div>
</div>


来源:https://stackoverflow.com/questions/42372560/looping-using-ngfor-and-skip-nth-element

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!