How to show display image before the data load in ionic 4

I am working on ionic 4 app. my app is working properly. Issue is that now i have list of objects having different prices and details. when i load the page everything is loaded but image take 2 3 second delay after data uploaded. i dont know how to resolve this. my html and .ts code is ass follow. any help would be appreciated.

<ion-row >
    <ion-col size="12" [ngClass]="{'featured': isFeatured() }" class="result-image"
             [ngStyle]="{'background-image': 'url(' + environment.API + 'images/'
             + itemType + '/' + data.coverImage + ')'}" no-padding>
    <ion-col size="7">{{ }}</ion-col>
    <ion-col size="5">
        <ion-badge *ngIf="offer" class="offer" color="warning">{{ offer.strapline }}</ion-badge>

and my .ts code is as

 isFeatured() {
  return &&
  moment(, moment(;
checkOffers(result: Venue | Event) {
        const validOffers = [];
        if (result.offers) {
            result.offers.forEach(offer => {
                const rule = new RRule({
                    dtstart: new Date(offer.rrule.dtstart),
                    until: new Date(offer.rrule.until),
                    freq: offer.rrule.freq,
                    byweekday: offer.rrule.byweekday,
                    bysetpos: offer.rrule.bysetpos || null,
                    bymonthday: offer.rrule.bymonthday || null,
                    byyearday: offer.rrule.byyearday || null,
                    count: offer.rrule.count || null,
                    byweekno: offer.rrule.byweekno || null,
                const date = new Date(;
                const occurences = rule.between(moment(date).utc().startOf('date').toDate(),
                occurences.forEach(occurance => {


        if (validOffers.length === 1) {
            this.offer = validOffers[0];

        if (validOffers.length > 1) {
            this.offer = {
                strapline: 'Multiple offers inside',
                description: '',
                duration: '',

check offer is called at ngOninIt.

you can try this …what it does is it will show a default image until the actual image is loaded from the server

but my client dont want a default message he wants smooth animation of both data and image this one is before the image shown and the other one is after the image display All data is using like an object

in default image you can also show gif. So in this way you can show an animated loading gif.

will let you know if anything else comes in my mind.

sure thanks alot i ll wait for your precious response

1 Like

You can use the app shell pattern and add a nice image shell into your app like in the following image. Check this tutorial for more details:

1 Like

u cna also use a plugin name ionic image loader it gives a lot of option to lazy load images or fall back images until the image gets downloaded and much more.

thanks alot for your response my client like it done

Hi, you can use Infinite Scroll…