/**
 * Created by PAVEI on 30/09/2014.
 */
angular.module('ionic-img-lazy-load').directive(
    'scroller', function ($document, $rootScope, $timeout) {
        return {
            restrict: 'A',
            link: function ($scope, $element, $attributes) {

                var id = 0,
                    scrollTimeoutId,
                    resizeTimeoutId;

                $scope.invoke = function () {
                    $rootScope.$broadcast('scrollEvent');
                }

                $element.bind('scroll', function (e) {

                    $timeout.cancel(scrollTimeoutId);

                    // wait for 200ms and then invoke listeners (simulates stop event)
                    scrollTimeoutId = $timeout($scope.invoke, 50);

                });


            }
        }
    });

angular.module('ionic-img-lazy-load').directive(
    'imageLazySrc', function ($document) {
        return {
            restrict: 'A',
            link: function ($scope, $element, $attributes) {
                var listenerRemover;


                var deregistration = $scope.$on('scrollEvent', function () {

                        if (isInView()) {
                            $element[0].src = $attributes.imageLazySrc; // set src attribute on element (it will load image)
                            deregistration();
                        }
                    }
                );

                function isInView() {

                    var clientHeight = $document[0].documentElement.clientHeight;
                    var clientWidth = $document[0].documentElement.clientWidth;
                    var imageRect = $element[0].getBoundingClientRect();
                    return  (imageRect.top >= 0 && imageRect.bottom <= clientHeight) && (imageRect.left >= 0 && imageRect.right <= clientWidth);
                }

                // bind listener
               // listenerRemover = scrollAndResizeListener.bindListener(isInView);

                // unbind event listeners if element was destroyed
                // it happens when you change view, etc
                $element.on('$destroy', function () {
                    deregistration();
                });

                // explicitly call scroll listener (because, some images are in viewport already and we haven't scrolled yet)
                if (isInView()) {
                    $element[0].src = $attributes.imageLazySrc; // set src attribute on element (it will load image)
                    deregistration();
                }
            }
        }
    }
);
@@ -36,16 +36,61 @@
 14.%0A */%0A
+%0Aangular.module('ionic-img-lazy-load', %5B%5D);%0A%0A
 angular.
@@ -1079,17 +1079,16 @@
 mover;%0A%0A
-%0A
         
@@ -1152,24 +1152,70 @@
 nction () %7B%0A
+                        console.log('scroll');
 %0A           
@@ -1955,16 +1955,17 @@
 istener%0A
+ 
         

Change to exemple