A simple infinite scroll solution for AngularJS weighing < 1 KB
(minified).
Getting started is very easy!
Requirements
- AngularJS
>=v1.2.0
(Should work with) - jQuery (at least)
>=v.1.7
(Planned in the future to be removed)
angular-infinite-scroll
is available on [Bower]:
$ bower install angular-srph-infinite-scroll --save
* The purpose of the --save
argument is to add it your bower file's dependencies.
angular-infinite-scroll
is also available on [CDN(s)]:
- Raw GIT
<script src="https://cdn.rawgit.com/srph/angular-infinite-scroll/master/dist/angular-srph-infinite-scroll.js"></script>
<!-- min -->
<script src="https://cdn.rawgit.com/srph/angular-infinite-scroll/master/dist/angular-srph-infinite-scroll.min.js"></script>
Include the script to your HTML file after jQuery and AngularJS (must be in proper order).
<!-- other scripts -->
<script src="/path/to/jquery.js"></script>
<script src="/path/to/angular.js"></script>
<script src="/path/to/angular-srph-infinite-scroll.js"></script>
Add the library module to one of your app module's dependencies.
angular.module('myApp', [/** other dependencies */, 'srph.infinite-scroll']);
Use the directive on a container element.
<div srph-infinite-scroll="callback()"
{disabled="true"}
{container="true"}
{throttle="0"}
{threshold="200"}>
<!-- your ng-repeat, typically -->
<div ng-repeat="apple in apples"> {{ apple.name }} </div>
</div>
* The { .. }
enclosures indicate that the parameter is optional.
Head over to the API Documentation to see accepted parameters, and how to use each.
Head over to the examples page to help you get started!
All contributions are appreciated. Please simply file an issue first for any inquiry, proposal, or question to avoid closed pull-requests; useless work. Thanks!
========= ================
| issue | -> | pull-request |
========= ================
Pull-requests with test or without are both appreciated!
Please check docs/building
- ng-scroller (
jankuca/ng-scroller
) - ngInfiniteScroll (
sroze/ngInfiniteScroll
) - lrInfiniteScroll (
lorenzofox3/lrInfiniteScroll
See the CHANGELOGS.md
Primarily motivated and almost based on sroze/ngInfiniteScroll.
angular-infinite-scroll © 2014+, Kier Borromeo (srph). Released under the MIT License.
srph.github.io · GitHub @srph · Twitter @_srph