-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
*ngFor and ngxViewer is not working well together #13
Comments
same problem here. *ngFor will not work. It works only with static img elements and url's. |
I was having the same problem when getting data later from a remote server. In my case, I needed to run the ngxViewer update function manually after updating the source variables of my *ngFor.
<div ngxViewer [viewerOptions]="viewerOptions" #imageViewer >
<img
*ngFor="let image of images"
src="{{ image.url }}"
alt="{{ image.filename }}"
/>
</div>
// Getting the elem to interact with
@ViewChild(NgxViewerDirective) imageViewer!: NgxViewerDirective;
...
this.images = [...this.images, ...images];
this.imageViewer.instance.update(); |
Hi @guisp thanks to your comment, I can solve my problem. I have a question tho: |
I am also facing same problem with angular 11. Any suggestions for me? |
I resolve my problem using bellow code: |
I have resolved the problem by using ChangeDetectorRef
|
I am using angular 12 and I have the following code. the issue is when I click on each image, nothing happens, no popup. However, if I remove *ngFor and manually put the image url in img tag, it works fine.
The text was updated successfully, but these errors were encountered: