What is Dependency Injection in Angular 4?

What is Dependency Injection in Angular 4?

Dependency injection (DI), is an important application design pattern. … DI is a coding pattern in which a class asks for dependencies from external sources rather than creating them itself. In Angular , the DI framework provides declared dependencies to a class when that class is instantiated.