I'm looking to update my configuration in the appsettings file by replacing a hardcoded string with a reference to the appsetting. Currently, I have this hardcoded value in appmodule.ts:
AgmCoreModule.forRoot({
apiKey: 'testtesttest',
libraries: ['places']
}),
and this is my corresponding section in appsetting.json:
"Geocode": {
"apiKey": {
"key": "testtesttest"
}
}
How can I modify it to dynamically read from the appsettings like this?
AgmCoreModule.forRoot({
apiKey: appsetting.Geocode.apiKey.key,
libraries: ['places']
}),