๐ Angular directive for infinite scrolling.
npm install @robingenz/ngx-infinite-scroll
Import the InfiniteScrollModule
:
import { InfiniteScrollModule } from '@robingenz/ngx-infinite-scroll';
@NgModule({
imports: [InfiniteScrollModule],
})
export class AppModule {}
<div
infiniteScroll
infiniteScrollThreshold="150px"
[infiniteScrollDisabled]="false"
(onInfiniteScroll)="loadMoreItems()"
>
<div *ngFor="let item of items">{{ item }}</div>
</div>
Name | Type | Required | Default | Details |
---|---|---|---|---|
infiniteScrollThreshold | string | โ | 200px | The threshold distance from the bottom of the element to call the onInfiniteScroll output event when scrolled.The value can be either a percent, or in pixels. |
infiniteScrollDisabled | boolean | โ | false | If true , the infinite scroll event listeners will be removed. |
Name | Type | Details |
---|---|---|
onInfiniteScroll | void | Emitted when the scroll reaches the threshold distance. |
A working example can be found here.
See CHANGELOG.md.
See LICENSE.