nikini / ionic-gallery-modal

Ionic Gallery Modal (to show all your photos)
166 stars 80 forks source link

To open the selected image in model unless specifying 'initialSlide' #48

Closed akhilsanker closed 6 years ago

akhilsanker commented 6 years ago

Hi, Using the plugin instead of ImageViewer plugin,due to advantage of navigation to other image by swiping. But the modal is not opened with the selected image,every time either first or the specified index image is opened in slider. Needs to open the clicked image in slider unless of the 'initialSlide' index.

Anybody has any suggestion. Any suggestion are appreciated.

Thanks,

Flink91 commented 6 years ago

I do this:

<img src="image.jpg" (click)="openGallery(1)">

and in .ts

openGallery(initialSlide : number){

    let modal = this.modalCtrl.create(GalleryModal, {

      photos: photos,
      initialSlide: initialSlide

    });
    modal.present();
  }

I hope that's what you are looking for!