Reputation: 946
How can I create a new bootstrap row every n items ? I tried *ngIf="idx % 2 === 0; else templateWithoutRow
but obviously it's not working.
Any idea ?
Thanks
Upvotes: 1
Views: 490
Reputation: 6821
try something like that but this is not really nice:
<div *ngFor="let row of items; let i = index">
<div *ngIf=" i % 4 === 0 " class="row">
<div *ngFor="let item of items.slice(i,i+4)">
{{item}}
</div>
</div>
</div>
I haven't verified the work of the code.
Upvotes: 4