I'm building an application with Angular with a .NET core backend. I have set an environment variable in both Angular and .NET.
And I'm wondering, is there a way to get the .NET's "ASPNETCORE_ENVIRONMENT" variable from Angular?
Expose an API that returns the current environment name. You can then use it from your Angular App.
Update:
appsettings.json (preferably in a json config file of it's own).Build events are supported. So if you use environment variables you can generate a config file on the fly (via build events) and your angular app can then access that as mentioned in step 3 above.