When we develop an application designed to run on multiple environments, we have to decide how to provide a configuration of appropriate variables depending on those environments

TLDR; 📕

  • environment.ts is not the best way to provide an environment configuration
  • do not introduce environmental configuration in build-time
  • Special injection token called APP_INITIALIZER is used for convenient and effective external configuration providing
  • I’ve prepared for you the minimal example which solves this problem by using APP_INITIALIZER. You can find it on StackBlitz

#frontend #environment-variables #angular #configuration

How does APP_INITIALIZER work? So what do you need to know about dynamic configuration in Angular?
6.55 GEEK