1.0.12 • Published 6 years ago

ng-infinitescroll v1.0.12

Weekly downloads
12
License
MIT
Repository
github
Last release
6 years ago

ng-infinitescroll

NPM

Demo

Installation

npm install --save ng-infinitescroll

Usage

Add InfiniteScrollModule to your list of module imports:

import {InfiniteScrollModule} from 'ng-infinitescroll';

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

Create an array(list) in your component:

import { Component } from '@angular/core';

@Component({
...
templateUrl: './app.component.html',
})
export class AppComponent {
  public list:string[] = [];
  
  loadData():void {
    // .. load more data for 'this.list'
  }
  
}

use the directive in your html templates:

  <div class="scroll-container" (ansynInfiniteScroll)="loadData()">
    <template ngFor [ngForOf]="list" let-item>
      <div class="item">{{item}}</div>
    </template>
  </div>

Outputs

     (ansynInfiniteScroll)="loadData()"

loadData() method will be called when scroll reaches the bottom.

Css

.scroll-container class should most include max-height and overflow:scroll or overflow:auto

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago