MurhafSousli / ngx-gallery

Angular Gallery, Carousel and Lightbox
https://ngx-gallery.netlify.app/
MIT License
610 stars 129 forks source link

Make it possible to use the gallerize directive in a container in which gallery items are added and removed dynamically. #599

Open haykoaghababyan opened 10 months ago

haykoaghababyan commented 10 months ago

I want to use the Gallerize Directive in a dynamically changing image container, when the first image is uploaded, that image is detected and a click event is added to it, when the second image is uploaded, a click event is added to the first element for the second time, and to the second element on the first time, how can it be done so that the click event does not occur on the first element the second time, because when I click on that element, a lightbox opens twice

MurhafSousli commented 10 months ago

Gallerize was initially meant for HTML content received from an API, where developers don't have control over the incoming content template.

If you have control over the content, why not use the [lightbox] directive? https://ngx-gallery-next.netlify.app/?path=/docs/documentations-lightbox--docs#3-add-lightbox-on-each-thumbnail-in-your-template

haykoaghababyan commented 10 months ago

Thanks, I tried and it worked !!!