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

import GalleryModule withConfig not updating

TheAndre980 opened this issue · comments

What is the expected behavior?

Each module initializing withConfig working.

What is the current behavior?

Gallery module not loading with config on some modules.

What are the steps to reproduce?

2 pages, each page with its own route, module and components. (the app has a lot more modules and pages).
I tried to import the LightboxModule and the GalleryModule with diferent configurations using the 'withConfig' function but only the Lightbox module seems to reflect the changes in config.

collection
artwork-details

What is the use-case or motivation for changing an existing behavior?

I just wanted to have these modules load with diferent configs correctly.

Which versions are you using for the following packages?

Angular: "15.2.4"
Angular CDK: "15.2.4"
Angular CLI: "15.2.4"
Typescript: "4.9.4"
Gallery: "8.0.3"

Is there anything else we should know?

Both pages are using gallerize on a div filled with imgs with both [src] and [attr.imageSrc] defined

The global default options is a single instance, and the gallery service is also singleton, at the moment using withConfig in multiple modules would overwrite the global default options, in your use case, you will need to use galleryRef.setConfig() method on the gallery instance