-
Notifications
You must be signed in to change notification settings - Fork 129
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
Can't set config #393
Comments
Looking at your code, it should work.. can you reproduce it in a stackblitz? |
What if you try to set the config in the ref() function? |
Also @MurhafSousli if you try to load config in the GalleryModule using forRoot method (you call it withConfig) it will not work. I believe the reason for it not working is following: In your gallery.service.ts you are injecting the config with GALLERY_CONFIG. However, the service itself is provided in root, and gets created sooner than the module, where the config value is resolved. Therefor this line will always only use defaultConfig since config will always be undefined. |
@EchopixUser you can inject the token in the root module to set the default config.. regarding withConfig function I am not sure, I haven't tested it after upgrading the service with |
I am providing it in my gallery module which amongst other things sets up your gallery module and hence the issue arises. I don't want to provide it in root, I have a modular architecture and the modules are sealed and independent. |
в ngOnInit не успевает |
@EchopixUser Providing a token in the root won't effect the modular structure, and won't add the plugin size to your main script if that what concerns you. |
I have a monorepo with multiple projects, so what concerns me is that I need to provide token with same value in every project. I would rather encapsulate it in my Module that would setup the config in one place for all my apps. Anyway the withConfig does not work because of of the hierarchy of providers you now have. |
@EchopixUser Can you think of a solution? |
Don't provide gallery in root by default. let the user chose the providing point. |
My template looks like that:
my Component like that:
Unfortunately the config get ignored. The image loading works but calling setConfig(...) or even writing
<gallery id="bilderGallery" [thumbs]=false></gallery>
won't changing anything. The gallery is loaded always with the default configuration.What am Im doing wrong?
Thx
The text was updated successfully, but these errors were encountered: