I am looking to implement a dynamic grid list using Angular 6's *ngFor
directive. I have an Array of 105 objects stored in firebase, each with the structure:
{src: 'some url', alt: 'title'}
These objects consist of two types of photos - horizontal and vertical. My goal is to create a section that automatically fills up empty space by utilizing a grid list in CSS3. How can I integrate this with the following code snippet:
<div class="row">
<div class="imageGallery1 " *ngFor="let image of galleryList">
<a [href]="image.src" [title]="image.alt">
<img [src]="image.src" [alt]="image.alt" style="max-width: 300px; max-height: 300px; object-fit: contain; padding-right: 20px;" />
</a>
</div>
Note: The styles provided are temporary for creating thumbnails.
Is there a way to identify the type of each photo (vertical or horizontal) and automatically sort them accordingly? Please advise if there is an alternative approach to achieving this.