Peter Boomsma
Peter Boomsma

Reputation: 9806

ngInfiniteScroll initially fill container-element with results

I have a scope with 150 elements in it and I'm using ngInfiniteScroll to alowe users to scroll through those results. But in my project I can't get the directive to initially fill the container element. It shows the number of results that I want to add whenever the bottom of the element has been reached, and because of that there's no scrollbar so users can't scroll to get to the extra content.

http://plnkr.co/edit/B7CRjvdQ9paytwl5csKi?p=preview

$scope.loadMore = function() {

  for(var i=0;i<10;i++) {
    if($scope.movies.length) {
      var movie = $scope.movies.pop();
      $scope.pagedData.push(movie);
    }
  }
}

If I change the 10 to 20 it starts with 20 examples. The desired result is that the container element is filled with results untill a vertical scrollbar shows up, from then it should only add results when the bottom of the element has been reached.

Upvotes: 0

Views: 51

Answers (1)

Prabhat Nigam ISDS
Prabhat Nigam ISDS

Reputation: 19

You can use infinite scrolling feature of ag-grid AG-Grid

Upvotes: 1

Related Questions