【发布时间】:2016-03-23 14:12:55
【问题描述】:
考虑我有 n 个项目。前 3 将跟进不同的风格和项目图像拍摄。接下来的2将跟进不同的风格和图像拍摄。接下来的4个将属于不同的风格和图像拍摄。我想在 ng-repeat 或通过自定义指令中排列这种变体。建议我遵循显示模式的最佳方式。
例如:
(*) (*) (*) // Medium Image
(@) (@) // Big Image
(.) (.) (.) (.) // small Image
....这种模式必须对所有 n 个项目重复,并带有分页。
<li ng-repeat="data in arrivCtrl.content"> // here getting list of objects with item details
<div class="ItemStyleWith3PerRow" ng-if="$index % 3 == 0" >...</div>
<div class="ItemStyleWith2PerRow" ng-if="$index % 2 == 0" >... </div>
<div class="ItemStyleWith4PerRow" ng-if="$index % 4 == 0" >... </div>
</li>
【问题讨论】:
-
请考虑添加一些代码。
-
哦,当然。添加。 @Michelem
标签: javascript css angularjs using-directives