I'm doing an infinite scroll page with angularjs that loads more items when the user reaches the bottom of the page. My problem is that under the infinite scroll container may or may not have more "stuff". So i don't want to load more items if the user reaches the bottom of the page if that "stuff" is present. So i want to load more items when the infinite scroll container reaches the end of that container and not the end of the page.

For the infinite scroll i have an angularjs directive like this:

```
myApp.directive("scroll", function ($window) {
    return function(scope, element, attrs) {
         angular.element($window).bind("scroll", function(event) {
             var docHeight = $(document).height();
             var reachBottom = $($window).scrollTop() == (docHeight - $($window).height());
             if (reachBottom) {
                  setTimeout(scope.loadMore(), 100);
             }
         });
    };
});

```