Riron / ionic-img-viewer

Ionic 2+ component providing a Twitter inspired experience to visualize pictures.
MIT License
283 stars 118 forks source link

Unable to swipe when using img viewer inside an ion-slide #64

Closed hamzatrq closed 7 years ago

hamzatrq commented 7 years ago

Greeting. I was trying to use the plugin inside an ion-slide component. But I am not able to swipe now. It will be a lot convenient if we can call a function on an event like (click)="openimage(imgUrl)" to trigger the plugin.

Riron commented 7 years ago

You mean that the swipe triggers a click event, and that the image opens in full screen mode ?

It will be possible to open it like you said in the next release.

QXCgxNED commented 7 years ago

I am also using image viewer inside Ionic Slides component. I am able to swipe though.

(Moved the rest of the comment to more relevant https://github.com/Riron/ionic-img-viewer/issues/65)

Riron commented 7 years ago

@QXCgxNED swiping does work for you ? I haven't reproduced the bug yet.

And calling the viewer throuh code is now possible in ionic-img-viewer@2.4.0.

hamzatrq commented 7 years ago

@QXCgxNED I have tried using image viewer inside ionic slides but was not able to swipe afterward can you please share your implementation?

QXCgxNED commented 7 years ago

I am really not doing anything special, it's actually pretty raw at the moment, could be improved.

<ion-content>
    <ion-header>
        [...]
    </ion-header>

    <ion-slides>
        <ion-slide *ngIf="user.Picture1 == 1">
            <img src="{{user.ImgSrc1}}" imageViewer />
        </ion-slide>
        <ion-slide *ngIf="user.Picture2 == 1">
            <img src="{{user.ImgSrc2}}" imageViewer />
        </ion-slide>
        [...]
    </ion-slides>
</ion-content>
Riron commented 7 years ago

I tried as well with the classic implementation and it works as expected.

@hamzatrq can you share your implementation ?

nisharai11 commented 7 years ago

Hi @Riron and @QXCgxNED , i am not being able to slide the viewed image using imageViewer. i tried the following:

```

it allows only single view and the slide is happening when the image is not viewed.
Any help would be appreciated.
Thank you.
Riron commented 7 years ago

Your HTML looks weird at first sight. You are repeating the whole <ion-slides>, not the <ion-slide>. Notice the s - try to make sure your code work without the imageViewer directive at first