An open API service indexing awesome lists of open source software.

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.

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-square

High 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 at

http://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.
```