Closed TupiC closed 9 hours ago
Because the lightbox has its own gallery instance. here is how you get the indexChanged
for the lightbox
@Component({ ... })
export class App {
constructor(public gallery: Gallery) {
}
ngOnInit() {
this.gallery.ref('lightbox').indexChanged.subscribe(x => {
console.log('lightbox index changed', x);
})
}
}
See fixed stackblitz
What is the expected behavior?
indexChanged should be called in lightbox mode
What is the current behavior?
indexChanged does not get called in lightbox mode
What are the steps to reproduce?
open https://stackblitz.com/edit/ng-gallery-index-change?file=src%2Fmain.ts indexChanged gets logged in "normal mode" but not in lightbox mode
What is the use-case or motivation for changing an existing behavior?
want to handle several things no matter the mode
Which versions are you using for the following packages?
Angular: 18.2.13 Angular CDK: 18.2.13 Angular CLI: 18.2.13 Typescript: 5.5.4 Gallery: 12.0.0
Is there anything else we should know?
-