Dependency Injection in Angular
What is it? According to Angular Docs, “DI (dependency injection) is a coding pattern in which a class asks for dependencies from external sources rather than creating them itself”. Why do we need it? The main use of DI is to avoid hard dependencies between classes. Decoupling the object creation from using these objects enables …