angular.js - ng-repeat循环第一条和其他的显示不一样

浏览:35日期:2023-01-27

问题描述

就是一个列表循环,第一条需要置顶显示,然后其他的在下面。我现在一个指令用了一个模板循环,实现不了啊,求救

问题解答

回答1:

http://stackoverflow.com/questions/19635636/first-in-ngrepeat

回答2:

在ng-repeat中有如下属性可用:

$index

$first

$middle

$last

$even

$odd

另外还有如下指令:

ng-repeat-start

ng-repeat-end参考:http://stackoverflow.com/questions/23627658/problems-with-ng-repeat-start

回答3:

用ng-class

相关文章: