当前位置: 代码迷 >> 综合 >> ionic中ion-slide-box 使用 ng-repeat 有的时候页面不渲染的问题
  详细解决方案

ionic中ion-slide-box 使用 ng-repeat 有的时候页面不渲染的问题

热度:94   发布时间:2023-12-10 22:55:17.0
方法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>

  相关解决方案