How to insert <br> tag in ng-repeat angular-js after every 5 elements

Viewed 1853

While Using ng-repeat , I need to print only 5 in a row

I have tried as shown below

<div ng-app="myApp" ng-controller="myCtrl">
  <div ng-repeat="n in names">
      <input type="checkbox" ng-click="select(n)"/>{{n}}
        <br ng-if="($n+1)%5==0">
  </div> 

</div>

But all the rows are getting printed in a single row

http://jsfiddle.net/9fR23/474/

5 Answers
Related