Skip to content
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

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 this issue Dec 21, 2023 · 2 comments

Comments

@sorcamarian
Copy link

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
Copy link
Owner

Please fill the template and add reproduction

@noxisams
Copy link

noxisams commented Apr 1, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants