有没有一种方法可以将ng-repeat中的$ index使用1而不是0?我不试图过滤掉数组中的第一项。对于贝宝,他们希望第一个为item_num_1 ...使用0无效,如
<div ng-repeat = "item in items">
<input type ="hidden" name ="item_num_{{$index}}" value ="item_num_{{item.id}}">
//the rest like this
</div>
也许您可以尝试一下。我不确定是否可以。祝好运
<div ng-repeat = "item in items track by $index">
<input type ="hidden" name ="item_num_{{$index + 1}}" value ="item_num_{{item.id}}">
//the rest like this
</div>
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句