Ray
Ray

Reputation: 780

Why Ionic slide show is not working?

I have a simple funky problem with ionic slide show, I am using the exact same method that ionic website says (Ionic Slide Show).

The code that I have is like the following:

<ion-slide-box on-slide-changed="slideHasChanged($index)" ng-repeat="img in itemPictures">
    <ion-slide>
       <img style="padding: 5px; border: solid 1px #EFEFEF;" class="full-image" ng-src="mydomain/{{img.Image_Path}}/{{img.Image_SRC}}"/>
    </ion-slide>
</ion-slide-box>

itemPictures array has the correct data, The problem is I am getting the images underneath each others where each image is like a slider by itself.

Thanks guys!!

Upvotes: 0

Views: 126

Answers (1)

Mudasser Ajaz
Mudasser Ajaz

Reputation: 6257

<ion-slide-box> is parent element of slider. It contains <ion-slide> elements inside it. You are repeating <ion-slide-box> instead you need to put ng-repeat in <ion-slide>.

   <ion-slide-box on-slide-changed="slideHasChanged($index)">
        <ion-slide ng-repeat="img in itemPictures">
           <img style="padding: 5px; border: solid 1px #EFEFEF;" class="full-image" ng-src="mydomain/{{img.Image_Path}}/{{img.Image_SRC}}"/>
        </ion-slide>
    </ion-slide-box>

Please look again at usage in documentation, you will understand.

Upvotes: 1

Related Questions