angular2 - NG-起动用种台+1 [英] angular2 - ng-for start with couter +1
本文介绍了angular2 - NG-起动用种台+1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想跳过第一个项目,ngFor:
I want to skip the first Item with ngFor:
<li *ngFor="#m +1 of [1,2,3,4]">{{m}}</li>
输出应该是: 2,3,4
什么是Angular2做到这一点的最好方法是什么?
What is the best way to do this in Angular2?
推荐答案
您可以与第二启动(或任意偏移)收集的项目进行的片管:
You can start with the second (or any arbitrary offset) items of the collection with the help of slice pipe:
<div *ngFor="#m of [1,2,3] | slice:1">{{ m }}</div> // will print 2 and 3
这篇关于angular2 - NG-起动用种台+1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文