Hey,

maybe you can use the index variable coming with ng-repeat to build something similar to your example.
I think about something like
</div ng-if="index % 4 == 0">
<div ng-if="index % 4 == 0">

this would add the breaking divs after every 4th element. the problem is they are inside the element with the ng-repeat directive.

I hope this helps anyway. bg,
Johannes



</div>
Am 13.03.2015 um 09:16 schrieb Aimery Marsily:
Hi !

I need to iterate through an array of 50 values with ng-repeat but I need to iterate on every 4 values grouped. My aim is to have something like :
|
<div>
    <span>1</span>
|    <span>2</span>
|||    <span>3</span>
|||    <span>4</span>
</div>|
|<div>
    <span>5</span>
|    <span>6</span>
|||    <span>7</span>
|||    <span>8</span>
</div>||
|

So for that I need to nest 2 ng-repeats. In PHP I'll use foreach (array_chunk($array->datas, 4) as $i => $datas) and then an other foreach on the $datas. But in AngularJS I realy don't know how to do so. Any ideas ?

Here is a basic plunker to work with : http://plnkr.co/edit/FfisnfVYhiahBxGARdgN?p=preview

Thanks
--
You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]>. To post to this group, send email to [email protected] <mailto:[email protected]>.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

--
--
Mit freundlichen Grüßen

Johannes Schneider
Front-End-Entwickler

Philippka-Sportverlag
Rektoratsweg 36
48159 Münster

Tel.: 0251/23 005-27
Fax: 0251/23 005-79

www.philippka.de
Philippka-Sportverlag GmbH & Co. KG - AG Münster HRA 9751
Persönl. haftende Gesellschafterin: Philippka Verwaltungs-GmbH
AG Münster HRB 14729 - Geschäftsführer: Ferdinand Honig, Thorsten Krybus

--
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to