Angular scrolled in an infinite scrolling directive which trigger a scope function when the user scroll to the end. It supports both vertical and horizontal scrolling.
Doesn't require jQuery.
Include in your HTML page
<script src="angular-scrolled.min.js"></script>Include it as app dependency
angular.module('app', ['angular-scrolled'])And use in your HTML template
<div scrolled="more()">
<div ng-repeat="item in items" class="item">
{{item.name}}
</div>
</div>See the demo app for examples on how to use all options.
Set the direction of the scrolling. Can be changed dynamically.
How far from the end of the scrolling area should the function be triggered. Can be changed dynamically.
Should the function be triggered or not. Can be changed dynamically.
Should the handler be attached to the window element. This is to allow the directive to be attached anywhere and still listen to the window scroll event instead of the element it is attached to.
To run the demo simply run npm start and visit http://localhost:8000
To run the tests have the demo up and running and then run the npm run protractor command.
- More tests