Reputation: 13
<ul class="stream-informer-short-list">
<li class="stream-informer-short-list-item" ng-repeat="streamer in streamerItems">
<a href="stream.html"><img src="{{streamer.imageUrl}}"></a>
</li>
</ul>
How i can use $index for offset first X items? {{streamer.imageUrl[$index+4}} - work uncorrectly. Or i must write filter for this action?
Upvotes: 0
Views: 507
Reputation: 364677
ng-switch can be used with $index to allow ng-repeat items to have different HTML:
<ul class="stream-informer-short-list">
<li class="stream-informer-short-list-item" ng-repeat="streamer in streamerItems">
<span ng-switch on="$index <= 4">
<a ng-switch-when="true" href="stream.html">
<img src="{{streamer.imageUrl[$index+4]}}"></a>
<a ng-switch-default href="stream.html">
<img src="{{streamer.imageUrl[$index]}}"></a>
</span>
</li>
</ul>
Upvotes: 1