Image zoom not working for dynamic data
Opened this issue · 2 comments
madasu commented
When we try to get dynamic data of images (from ngx store), zoom doesn't work anymore...
wittlock commented
Could you provide an example of what's not working? Do you get any errors in the console?
pixelein commented
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);
}