#1 Data Analytics Program in India
₹2,499₹1,499Enroll Now
6 min read
Question 8 of 46medium

Dependency Injection

Angular DI system and providers.

What is Dependency Injection?

DI is a design pattern where dependencies are provided to a class rather than created by the class. Angular has a built-in DI system.

Injection Hierarchy

  1. Root level: providedIn: 'root'
  2. Module level: providers array in NgModule
  3. Component level: providers array in @Component