How do you configure injectors with providers at different levels?

You can configure injectors with providers at different levels of your application by setting a metadata value. The configuration can happen in one of three places,

  1. In the @Injectable() decorator for the service itself
  2. In the @NgModule() decorator for an NgModule
  3. In the @Component() decorator for a component

May 18, 2022
147