How to load more data in ng-repeat if there’s not enough?

I have a filter in ng-repeat and ng-if condition and there almost always will be less then 10 results per page (10 results is what I get from API).

My idea is that in js file should be a cycle with condition

First we declare variable so we can check the length

           var numberOfArticlesOnPage = container.children.length

           for (i = 0; numberOfArticlesOnPage < 10); i++ {
               $scope.pageNumber = $scope.pageNumber + 1
               var i=1
                       method: 'GET',

//Here I put i instead of page number so it loads next page and every time we create results[i] with new number in the end

'"Politics")&page=' + i + '&api-key=groQeNemKAhk7QjDWircgauo5jYVcwez', /* Most recent */
                   }).then(function successCallback(result) {
                       $scope.results[i] =;
                   }, function errorCallback(result) {
                       console.log("there's a error, man...");
                //Check the length again
                   var container = document.querySelector(".container");
                   var numberOfArticlesOnPage = container.children.length```

//And that is the template where it should be shown

```<div class="container">
           <div class="box" ng-repeat="result in results | filter : '!trump'" ng-if="result.multimedia[2].url != null">
               <p class="abstract">{{result.abstract}}</p>
               <img src="{{result.multimedia[0].url}}">
               <a ui-sref="article ({
               articleSlug:'{{result.headline.main | slugify}}', 
               title: '{{result.headline.main}}',
               url: '{{result.web_url}}', 
               image: '{{result.multimedia[0].url}}',
               externalUrl: '{{result.url}}'
               })">Read more...</a>

//But I don't know how to write a code in the template so it can take more data?

Source: New feed
Source Url How to load more data in ng-repeat if there’s not enough?