I am trying to customize an ng-repeat
to add something like a br
tag to every 4th element. I have tried searching around but cannot seem to find a solid answer. Is there a simple way to add conditions to Angular for something like this? my ng-repeat
is just adding some spans
with content in them, but I need to start a new line every 4th element.
i.e. I want the following
item1 item2 item3 item4
item5 item6 item7 item8
but right now it just does this
item1 item2 item3 item4 item5 item6 item7 item8
If there are any good articles relating to ng-repeat
customization (for newbies) I would be thankful for links as well as everything I have found thus far is too difficult to understand.
HTML
<div class="section">
<div ng-repeat="items in MyList">
<img ng-click="AddPoint($index)" src={{items.image}} />
<span>{{items.currentPoint}}/{{items.endPoint}}</span>
</div>
</div>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…