Skip to content

Instantly share code, notes, and snippets.

View amitparrikar's full-sized avatar

Amit Parrikar amitparrikar

  • Goa
View GitHub Profile
@amitparrikar
amitparrikar / InfiniteScroll.js
Last active June 14, 2017 10:01
An AngularJS directive called InfiniteScroll; Infinite Scrolling mechanism is used in lazy loading. It gets a callback handler which then gets called when scrolling has reached to the bottom of the element.
/**
* InfiniteScroll is a AngularJS directive.
* This directive calls your callback function when scrolling of an element is reached to the bottom.
*/
'use strict';
angular.module('InfiniteScroll', []).directive('infiniteScroll', function () {
return {
restrict: 'A',
scope: {
callback: '&infiniteScroll'