Add a <br> every 5 item with ng-repeat

  angularjs

I’m trying to get an html <br> tag after a determined amount of elements with ng-repeat. As an example every 5th button gets a <br> appended to it. I tried multiple approaches but can’t seem to get it right. I’d appreciate if anyone can give me some pointers on how to achieve this. Thanks in advance.

<button type="button" class="btn btn-default btn-small" ng-repeat="item in items"
     {{item}}
</button>

Source: AngularJS Questions

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.