方法1:
.controller("XXXXCtrl", ["$scope", "$ionicSlideBoxDelegate", "$http",
function ($scope, $ionicSlideBoxDelegate, $http) {
$http.get(url).success(function(data) {
$scope.slides =data.XXXXX;
});
$scope.updateSlider = function () {
$ionicSlideBoxDelegate.update();
}
});
<ion-slide-box ng-init="updateSlider()" on-slide-changed="slideHasChanged($index)" auto-play="true" does-continue="true" slide-interval=2000>
<ion-slide ng-repeat="item in XXXX">
<div>
<img src={{item.XXXX}}>
</div>
</ion-slide>
</ion-slide-box>
方法2:
.controller("XXXXCtrl", ["$scope", "$ionicSlideBoxDelegate", "$http",
function ($scope, $ionicSlideBoxDelegate, $http) {
$http.get(url).success(function(data) {
$scope.slides =data.XXXXX;
});
});
<ion-slide-box ng-if="XXXX != null" on-slide-changed="slideHasChanged($index)" auto-play="true" does-continue="true" slide-interval=2000>
<ion-slide ng-repeat="item in XXXX">
<div>
<img src={{item.XXXX}}>
</div>
</ion-slide>
</ion-slide-box>