ngx-image-zoom icon indicating copy to clipboard operation
ngx-image-zoom copied to clipboard

Image zoom not working for dynamic data

Open madasu opened this issue 6 years ago • 2 comments

When we try to get dynamic data of images (from ngx store), zoom doesn't work anymore...

madasu avatar Jun 19 '19 23:06 madasu

Could you provide an example of what's not working? Do you get any errors in the console?

wittlock avatar Jul 17 '19 17:07 wittlock

In my situation I need change image when thumb click. So I decided reinitialize ngx-image-zoom after image link changed by setting a timer. This was fixed the issue temporarily.

<div class="image-container" *ngIf="show_main_image === true">
    <ngx-image-zoom
        [thumbImage]="image"
        [fullImage]="image_big"
    ></ngx-image-zoom>
</div>

And in .ts file by default is show_main_image = true

onThumbClick() {
        /*  image changes here  */

        this.show_main_image = false;

        setTimeout(
            () => {
                this.show_main_image = true;
            }, 100);
}

pixelein avatar Aug 18 '19 01:08 pixelein