-
Notifications
You must be signed in to change notification settings - Fork 14
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
Use dynamic configuration in AzureMapsModule.forRoot() #35
Comments
Hi, The
But I am not sure this would allow you to set the key from your API. Maybe what you actually need here is an APP_INITIALIZER which calls you API to retrieve the subscription key and set it on the configuration of the library ? Something like that :
|
Both are in any case valid use cases that I would add to the library. None would currently work as neither |
Thank you for your quick reply! That would be great! main.ts
app.module.ts
I'm looking forward to the code change! |
I just published a version
If at some point you want to use the APP_INITIALIZER, you would need to call Would you mind trying this version and letting me know if this works for you ? If so, I will publish a stable version later this day. |
I've tested it, it works perfectly! Thank you very much for adding this valuable piece of functionality! |
Great, thanks for the feedback and for the feature request! I have just published a stable version 3.6.0. I will close this issue, feel free to reopen it if necessary! |
Hello,
I'm trying to load ng-azure-maps with data that comes from a settings API. So my
subscriptionKey
is different per environment, and not static.I already know it's impossible to have a service injected into the
imports
part of the@NgModule
decorator. But I would think it's possible to have a provider which overrides theAZUREMAPS_CONFIG
InjectionToken.Now I'm facing the error:
Am I on the right track? Or is there another way to do this?
The text was updated successfully, but these errors were encountered: