Angular · Senior · Question 19 of 75

How do you load configuration before the app renders?

providers: [
  provideAppInitializer(() => inject(ConfigService).load()),
]

Explanation

Bootstrap waits for initializers to finish. Keep them fast and handle errors: a failed initializer blocks the whole application from starting.

Further reading

Problem with a question

Angular · Senior · question 19

Test yourself

Take the Angular · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz