whenscrolled

0.0.1 • Public • Published

whenscrolled

Simple directive which allows to execute callback when user scrolls towards end of the scrollable height. This is very useful if you want to implement infinite scrolling.

usage

In your html

<ul when-scrolled="loadMore()">
  <li ng-repeat="i in items"></li>
</ul>

In your javascript controller:

require('whenscrolled');
 
function Controller($scope) {
  $scope.loadMore = function () {
    // will be called when user scrolled towards the bottom of availble height
  }
}

see also

https://github.com/anvaka/an - describes idea behind CommonJS friendly angular packages

install

With npm do:

npm install whenscrolled

license

MIT

Package Sidebar

Install

npm i whenscrolled

Weekly Downloads

3

Version

0.0.1

License

MIT

Last publish

Collaborators

  • anvaka