I am currently facing an issue while trying to implement infinite scroll using ngx-infinite-scroll in an Angular 4 application. Despite following the documentation and configuring the height
of the element while setting scrollWindow
to false, the trigger is not happening as expected. What could I possibly be doing wrong here?
To demonstrate the problem, I have created a Plnkr with the reproduction of the issue.
HTML:
<div class="search-results"
infinite-scroll
[infiniteScrollDistance]="0.1"
[infiniteScrollThrottle]="10"
[scrollWindow]="false"
(scrolled)="onScrollDown()">
<p *ngFor="let i of is">
{{i}}
</p>
</div>
CSS:
.search-results {
height: 100px;
overflow: scroll;
}
Component:
protected is = ['Item1', 'Item2', 'Item3'];
onScrolledDown() {
console.log("scrolled");
}