Overview
This is a library for AngularJS built with TypeScript to manage displayed elements in an ng-repeat like manner.
Features
- ng-repeat syntax (limited)
- configurable
- supports both scroll direction
- cleans elements
Installation
Import angular-infinite-scroller module to your main angular module.
Then you are free to use the infinite-scroller directive.
Styling! Make sure to set height and overflow of the parent container!
Simplest example:
Usage
Simple list
Simple list loading from 1 to 100
Result
{{item}}
Tables
Some CSS tweek is needed for tables to work
Result
id | name |
---|---|
{{row.id}} | {{row.name}} |
Known issues
Binding with curly brackets
First population of items is using calculation based on items' height, so it's important to make rows rendered with it's final height even before the binding actually happened.
To prevent accidental linebreaking before the template is linked avoid using brackets for longer texts. Instead of: Use:
One time binding
DOM elements in the list are reused in the scrolling process, and are not cleaned up completely.
To make this behaviour work, avoid using one time binding in the list.