Angular Dependency Injection — Using “Injector” Service instead of long list of services in Component’s constructor

The Angular framework provides Dependency Injection (DI) out of the box. The easiest way to understand DI is to “Delegate creation of instance task to a global authority and just ask for the instance when you want to use it”.

Let’s make it simple, when we create a new service say and provide it in a Root module, the decorator let Angular compiler know to register this class in a DI registry…

--

--

Google Developer Expert Angular | Architect | Author | https://www.linkedin.com/in/balram-chavan | https://www.hiretheauthor.com/balramchavan

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store