I have SlideBox to show images from a remote source. It works great and I have no issues with that.
Initially I am loading 8 images and then later I want to add more images to the slide box.
Below is the view for slide box.
<ion-slide-box show-pager="false" on-slide-changed="slideChanged()">
<ion-slide ng-repeat="item in items">
<ion-content>
<div class="list card">
<img class="full-image" ng-src="{{item.url}}">
</div>
</ion-content>
</ion-slide>
</ion-slide-box>
Below is the controller logic.
app.controller('ViewCtrl', function($rootScope, $state, $scope, $ionicSlideBoxDelegate, Service) {
var page = 0;
var displayLimit = 8;
Service.showWaiting();
$scope.items = [];
Service.getRemoteItems(page, displayLimit).then(function(results) {
$scope.items = results;
$rootScope.itemData = results;
$ionicSlideBoxDelegate.update();
Service.hideWaiting();
},
function(e) {
Service.hideWaiting();
alert("Error getting designs. Please retry later.");
}
);
}
What’s the best approach to add slides to the end of the slide-box? How this can be achieved?