0

i have a array of 50 objects and i'm trying to fetch data from each array and display it in ionic slides

<ion-content scroll="false">
        <ion-scroll direction='y'>
            <ion-slide-box show-pager="false" ng-repeat="result in data| limitTo:1">
                <ion-slide class="slider-class" ng-repeat="result in data">
                    <!--my data -->               
                </ion-slide>
            </ion-slide-box>
        </ion-scroll>

i've tried applying ng-repeat only for <ion-slide>but it doesn't work. So had to use ng-repeat like this.

i'm creating an empty array and pushing 10 data at a time to the array 5 times. enter image description here

$http.get(apiURL)
      .then(function(response){
        var array = new Array();
        array.push(response.data.results);
        for(var i=2;i<=5;i++){
          $http.get(apiURL+'/?page='+i)
          .then(function(response){
            for(var i=0;i<=9;i++){
              array[0].push(response.data.results[i]);
            }
          })
        }
        $scope.data= array[0];
    });

response.data.results is an array of 10 objects which is being stored in 0th index of array. so i'm pushing 10 more objects to the 0th index everytime.

Gururaj Bhandarkar
  • 292
  • 1
  • 3
  • 14

0 Answers0