MurhafSousli / ngx-gallery

Angular Gallery, Carousel and Lightbox

Home Page:https://ngx-gallery.netlify.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

sorcamarian opened this issue · comments

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?

Please fill the template and add reproduction

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);