I want to add placeholder image to my ion-slider before my images are loaded dynamically. Here is my code:
HTML
<div *ngIf="service?.banners" class="home-banners">
<ion-slides pager="true" spaceBetween="5" loop="true" autoplay="3900">
<ion-slide *ngFor='let value of service.banners'>
<img src="{{value}}">
</ion-slide>
</ion-slides>
</div>
SCSS
.home-banners {
ion-slides {
height: 50%;
padding-left: 5px;
padding-right: 5px;
padding-top: 5px;
}
}
If you pursue lazy loading approach you could do something like this below:
html template:
Component code example:
scss: