javascript - AngularJS ng-repeat rows/ul -


i have json array various objects , want show these objects in html using ng-repeat, follows:

<ul>     <li>object 1</li>     <li>object 2</li>     <li>object 3</li>     <li>object 4</li> </ul> <ul>     <li>object 5</li>     <li>object 6</li>     <li>object 7</li>     <li>object 8</li> </ul> 

basically want show 4 items per row (ul) how can that?

thanks!

you can use filter limitto

ng-repeat="item in items | limitto:4" 

update:this should work

<ul ng-repeat="item in arr" ng-if="$index%4==0">   <li ng-repeat="item in arr|limitto:4:$index" >     {{item}}    </li> </ul> 

plnkr


Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -