13.0.0 ā€¢ Published 2 years ago

@robingenz/ngx-infinite-scroll v13.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

ngx-infinite-scroll

npm (version) npm (downloads)

šŸ“œ Angular directive for infinite scrolling.

Installation

npm install @robingenz/ngx-infinite-scroll

Import the InfiniteScrollModule:

import { InfiniteScrollModule } from '@robingenz/ngx-infinite-scroll';

@NgModule({
  imports: [InfiniteScrollModule],
})
export class AppModule {}

Usage

<div
  infiniteScroll
  infiniteScrollThreshold="150px"
  [infiniteScrollDisabled]="false"
  (onInfiniteScroll)="loadMoreItems()"
>
  <div *ngFor="let item of items">{{ item }}</div>
</div>

API

Properties

NameTypeRequiredDefaultDetails
infiniteScrollThresholdstringāœ•200pxThe 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.
infiniteScrollDisabledbooleanāœ•falseIf true, the infinite scroll event listeners will be removed.

Events

NameTypeDetails
onInfiniteScrollvoidEmitted when the scroll reaches the threshold distance.

Example

A working example can be found here.

Changelog

See CHANGELOG.md.

License

See LICENSE.