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/
You could have it like this:
<div ng-repeat="n in names" style="display: inline">
<input type="checkbox" ng-click="select(n)"/>{{n}}
<div ng-show="($index + 1) % 5 === 0">
<br>
</div>
</div>
working fiddle
<div ng-app = "myApp" ng-controller="myCtrl">
<div ng-repeat="n in names">
<input type="checkbox" ng-click="select(n)"/>
<br ng-if="($index+1)%5==0">
</div>
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With