ionic tutorial - Load n number of available data on demand in Ionicframework - ionic framework - ionic 2 - ionic creator - ionic development



HTML :

<li class="item" ng-repeat="schedule in Schedules | filter:scheduleSearch | limitTo:numberOfItemsToDisplay">
    Display some data
</li> 
<ion-infinite-scroll on-infinite="addMoreItem()" ng-if="Schedules.length > numberOfItemsToDisplay">
</ion-infinite-scroll>
Click below button to copy the code. From wikitechy - ionic tutorial - ionic framework tutorial - team

Controller :

$scope.numberOfItemsToDisplay = 10; // Use it with limit to in ng-repeat
$scope.addMoreItem = function(done) {
    if ($scope.Schedules.length > $scope.numberOfItemsToDisplay)
        $scope.numberOfItemsToDisplay += 10; // load number of more items
        $scope.$broadcast('scroll.infiniteScrollComplete')
}   
Click below button to copy the code. From wikitechy - ionic tutorial - ionic framework tutorial - team

Load 10 items every time addMoreItem() call.


Related Searches to Load n number of available data on demand in Ionicframework