I'm using Angular 8 for a blog based web-app. Data is stored in json file for now, even images to be loaded along with the path.
JSON data
[
{
"imgSrc": "./assets/images/dalai-hills-1.jpg",
"destination": "Dalai Hills",
"introTitle": "through happy valley, to a picturesque place",
"place": "mussoorie, uttarakhand",
"description": "Lorem ipsum dolor sit amet, no elitr tation delicata cum, mei in causae deseruisse.",
}
]
The imgSrc decides which image to load. All the images are already optimized and places inside assets folder.
Template
<article class="blog-card" style="border-top: 0;" *ngFor="let blog of blogsList">
<div class="blog-img-wrap" style="min-height: 200px;">
<a href="#"">
<img loading="lazy" class="img-fluid blog-img" src="{{ blog.imgSrc }}" alt="blog-image-1">
</a>
</div>
</article>
Let's say, in the blogs page, on load there are 12 images loading because of , I want to ensure page should load only after all the images are loaded.
I am not getting any concrete answer on stackoverflow. Currently, there is a very small fraction of seconds difference between the text and images getting loaded but it looks weird.
Any solutions on the same?
P.S: I want to avoid jQuery.