0

I make an app based on ionic 2 that use the Infinite Scroll.

I got a little problem.. The event triggred multiple times that make my app not working well

Here's the code on the component for Infinite scroll

doInfinite(infiniteScroll) {
  this.page += 1;

    this.loadPosts(this.page,"infinite");

  console.log(this.page);
  infiniteScroll.complete();
}

and this console.log(this.page) give me a 7. Why it jump to 7 ? not to the 2 first ?

It's weird, It' like multiple times triggred, so the this.page keep going up till the service load the data..

Here's the HTML Code

<ion-infinite-scroll (ionInfinite)="doInfinite($event)">
    <ion-infinite-scroll-content
        loadingSpinner="bubbles"
        loadingText="Loading more data...">
    </ion-infinite-scroll-content>
</ion-infinite-scroll>

0 Answers0