SnailMann
SnailMann

Reputation: 23

Angular 4 :load more data when the scroll move to the bottom with ngx-infinite-scroll and it not work

Goal:

I want to achieve a function that load more data when the scroll move to the bottom. We used the ngx-infinite-scroll plug-in (https://github.com/orizens/ngx-infinite-scroll) to implement it ,but it not working.

Expected results:

it will triggle onScrollDown() function to load more data when the scroll move to the end.

Actual results:

it triggled the onScrollDown() function when the scroll move to the middle approximately

Code:

<div class="row" infinite-scroll [infiniteScrollDistance]='0'(scrolled)="onScrollDown()">
              ...show-list code...
</div>

onScrollDown() is ok, and i set infiniteScrollDistance to 0 but it not work.

So ,how can i fix it ?thanks in advance.

Upvotes: 1

Views: 5210

Answers (1)

ZOXEXIVO
ZOXEXIVO

Reputation: 960

Try using outer container with parameters

[fromRoot]="true"
[infiniteScrollDistance]="0.1"

Upvotes: 1

Related Questions