离子滑动盒不能与ng-repeat一起使用

Cra*_*oiD 1 angularjs cordova ionic-framework

我需要使用离子滑动框在我的应用程序中显示一些图像.我使用了离子滑动盒,它似乎不适用于ng-repeat.

这是我的HTML部分

<ion-view title="Promotions" ng-controller="PromotionsCtrl">


     <ion-content  class="has-header" scroll="true" padding="true">
        <ion-slide-box>

                <ion-slide ng-repeat="obj in promotions">
                        <img ng-src= {{obj.img}}> 

                </ion-slide>

         </ion-slide-box>
    </ion-content>
</ion-view>
Run Code Online (Sandbox Code Playgroud)

我的控制器

.controller('PromotionsCtrl', function($scope, $http, $window, $ionicSlideBoxDelegate,$interval) {





            $http.get(  'http://******.com/B*****/service2.php?q=promotions', { cache: true})
            .then(function(res){

                  $scope.promotions = res.data['top'];


                  $ionicSlideBoxDelegate.update();
                  });
                  })
Run Code Online (Sandbox Code Playgroud)

Sub*_*ect 7

如果您使用带有幻灯片的ng-repeat,则必须使用update().

看这里:

http://ionicframework.com/docs/api/service/%24ionicSlideBoxDelegate/