How to open image on click in ion-slide-box?


#1

Hello,
I try to make a carousel of images using ion-slide-box. Here is my code:

   <ion-slide-box delegate-handle="img-viewer" auto-play="false" does-continue="true" ng-if="zaved_img.length > 0">
      <ion-slide ng-repeat="img1 in zaved_img">
        <div class="item item-image">
          <img ng-src="http://site.ru/admin/files/{{img1.img}}">
        </div>
      </ion-slide>
    </ion-slide-box>

How to open image on click and view by scrolling left/right swipe?

Sorry, my english is bad.


#2

Create a method for click on image and use ng-click in in your slide box…it is simple


#3

Please help for example method


#4

app.js

$scope.clickOnImg=function(img){

   alert("img  " +img);

}

img.html

 <ion-slide-box delegate-handle="img-viewer" auto-play="false" does-continue="true" ng-if="zaved_img.length > 0">
  <ion-slide ng-repeat="img1 in zaved_img">
    <div class="item item-image">
      <img ng-src="http://site.ru/admin/files/{{img1.img}}" ng-click="clickOnImg({{img1.img}})">
    </div>
  </ion-slide>
</ion-slide-box>

#5

Dont work this code. Why you use “Alert” ???


#6

alert is just for testing…for check method is working or not… it can be replace with your code…don’t think about it