ng2-infinitescroll

2.0.0 • Public • Published

ng2-infinite-scroll

The sources for this package are in (https://github.com/sharmilemurugaraj/ng2-infinite-scroll) repo. Please file issues and pull requests against that repo.

Usage

Include the following lines in typescript file.

 
import {Component} from '@angular/core';
import {InfiniteScroll} from '../directives/angular2-infinitescroll';
 
@Component({
    selector : 'my-app',
    directives: [InfiniteScroll],
    template:  `
        <div (OnScrollMethod)="nextPage()" ScrollDistance="3" InfiniteScroll="InfiniteScroll"></div>
        `
    styleUrls['style.css']
})
export class AppComponent {
    nextPage() {
        console.log('Reached Bottom!!');
    }
}

style.css

Custom css must be added to set the height for the particular div. Height can be changed according to the screen.

 
.search-results{
    height: 180px !important;
    overflowscroll;
}

Package Sidebar

Install

npm i ng2-infinitescroll

Weekly Downloads

4

Version

2.0.0

License

MIT

Last publish

Collaborators

  • sharmi_010493