MurhafSousli / ngx-gallery

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

ng-gallery.mjs:287 [NgGallery]: Unable to set the active item because the given index (1) is outside the items range! #594

Open sorcamarian opened 11 months ago

sorcamarian commented 11 months ago

I get this error: ng-gallery.mjs:287 [NgGallery]: Unable to set the active item because the given index (1) is outside the items range!

Which versions are you using for the following packages?

Angular: 16 Angular CDK: Angular CLI: Typescript: Gallery:

Is there anything else we should know?

MurhafSousli commented 11 months ago

Please fill the template and add reproduction

noxisams commented 7 months ago

Organize your code well in this order, and I think the problem will be fixed

const lightboxRef = this.gallery.ref('lightbox'); lightboxRef.load(images); this.lightbox.open(); lightboxRef.set(index);