I have a name of the environment embedded into the app component like:
<app-component env="dev" />
I need to get some configuration from the backend based on this attribute on the app-component
.
This config has to be in place before any other call to the backend happens (since they all use this config).
What/when is the best way to handle it?
Is APP_INITIALIZER
a proper way to do it? Or does APP_INITIALIZER
happen even before I can access app-component
attribute?
The other option I can consider is just a global js/ts variable within index.html
.
The third option is a resolver/guard on /
route.