What are the types of injector hierarchies?

Posted by Jennifer | Updated on

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().

If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers