What are the types of injector hierarchies?

There are two types of injector hierarchies in Angular

  1. ModuleInjector hierarchy: It configure on a module level using an @NgModule() or @Injectable() annotation.
  2. ElementInjector hierarchy: It created implicitly at each DOM element. Also it is empty by default unless you configure it in the providers property on @Directive() or @Component().

May 15, 2022