A port of ng-infinite-scroll directive for angular 2.
Currently supports:
- (attribute) "infinite-scroll-distance" - should get a number
- (function) - instead of defining a callback function on the "infinite-scroll" attribute, you should use the event binding (scrolled)="handleScrollCallback()"
in component, define:
import { Component } from 'angular2/core';
import { InfiniteScroll } from 'angular2-infinite-scroll';
@Component({
selector: 'app',
directives: [ InfiniteScroll ]
template: `
<div class="search-results"
infinite-scroll
[infiniteScrollDistance]="2"
(scrolled)="onScroll()">
</div>
`
})
export class App {
onScroll () {
console.log('scrolled!!')
}
}