https://github.com/bcherny/infinite-scroll
High performance infinite scrolling for AngularJS.
https://github.com/bcherny/infinite-scroll
Last synced: 6 months ago
JSON representation
High performance infinite scrolling for AngularJS.
- Host: GitHub
- URL: https://github.com/bcherny/infinite-scroll
- Owner: bcherny
- License: apache-2.0
- Created: 2014-05-29T23:14:50.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-12-23T19:40:32.000Z (almost 11 years ago)
- Last Synced: 2025-03-29T12:02:25.814Z (6 months ago)
- Language: CoffeeScript
- Size: 344 KB
- Stars: 6
- Watchers: 8
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# infinite-scroll [![Build Status][build]](https://travis-ci.org/bcherny/infinite-scroll) [![Coverage Status][coverage]](https://coveralls.io/r/bcherny/infinite-scroll)
[build]: https://img.shields.io/travis/bcherny/infinite-scroll.svg?branch=master&style=flat-square
[coverage]: http://img.shields.io/coveralls/bcherny/infinite-scroll.svg?branch=master&style=flat-squareHigh performance infinite scrolling for AngularJS.
## Features
- High performance: doesn't slow the user's scrolling
- Tiny
- Configurable
- Unopinionated
- Supports any number of infinite scroll views on one page## Dependencies
- Angular 1.0.8
- jQuery ^1.11## Why?
Because [ngInfiniteScroll](https://github.com/BinaryMuse/ngInfiniteScroll) listens to the `onScroll` event, bogging down page performance, and is unnecessarily complex.
## Installation
```bash
bower i -S https://github.com/bcherny/infinite-scroll.git
```## Usage
*template.html*
```html
```*module.js*
```js
require('infinite-scroll');angular
.module('myModule', ['turn/infiniteScroll'])
...
```*controller.js*
```js
function Controller ($scope) {
$scope.callbackFn = function() {
// must return a thenable promise
// see demo/index.html if you're not sure what that means
};
}
```*Note: When `callbackFn` returns a rejected promise, infinite-scroll will deactivate itself. It can then be reactivated by setting the infinite-scroll-active attribute to true.*
## Configuration
*template.html*
```html
```## Todo
- Integration tests
## License
```
Copyright 2014 Boris Cherny.Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```