0

This is my first ionic application.

I am adding an infinite scroll to my ionic page:

doInfinite(infiniteScroll) {
    //this.getOrders(0, this.pageSize);
    setTimeout(() => {
      for (let i = 0; i < this.length; i++) {
        this.getOrders(0, this.pageSize++);
        this.orders.push(this.orders[i]);
      }

      infiniteScroll.target.complete();
    }, 500);
  }

And here is the html:

<ion-infinite-scroll (ionInfinite)="doInfinite($event)">
   <ion-infinite-scroll-content loadingText="Loading Data">
   </ion-infinite-scroll-content>
</ion-infinite-scroll>

The problem is when scrolling down and all data is loaded, the loader is still visible and request is made to database.

No errors at the console.

alim1990
  • 4,656
  • 12
  • 67
  • 130

1 Answers1

1

when all data is loaded you need add this

infiniteScroll.target.disabled = true;
Cenk YAGMUR
  • 3,154
  • 2
  • 26
  • 42