'Angular Flex-layout with ngFor, X elements per row
I tried to follow this post Angular flex-layout with ngFor to do what I want but I can't make it.
I have this code:
<div *ngFor="let room of listRoom;">
<div class="room">
Room {{room.label}}
<div *ngFor="let bed of room.beds;">
<div class="bed">
Bed #{{bed.label}}
<button mat-raised-button color="accent" (click)="assignThisBed(bed)">
Assign this bed
</button>
</div>
</div>
</div>
</div>
My listRooms
contains usually between 10-15 elements
and I'd like to have 3 rooms on a row then breakline, 3 rooms, ...
Can someone help me? Thanks..
Here is a StackBlitz with my code.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|