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
Marian commented
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?
Murhaf Sousli commented
Please fill the template and add reproduction
noxisams commented
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);