Created
April 3, 2016 14:15
Revisions
-
Julian Maicher created this gist
Apr 3, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ export default function endlessContainer() { 'ngInject'; return { restrict: 'A', scope: { 'endlessContainer': '&' }, link: function (scope, element, attrs) { element.bind('scroll', function() { let height = this.scrollHeight - element.height(); let scrollTop = element.scrollTop(); let isScrolledToEnd = (scrollTop >= height); if(isScrolledToEnd) { scope.$evalAsync(scope.endlessContainer); } }); } } }