What is dependency injection In AngularJs and how does it work?

devquora
devquora

Posted On: Feb 22, 2018

 

AngularJS was designed to highlight the power of dependency injection, a software design pattern that places an emphasis on giving components of their dependencies instead of hardcoding them within the component. For example, if you had a controller that needed to access a list of customers, you would store the actual list of customers in a service that can be injected into the controller instead of hardcoding the list of customers into the code of the controller itself. In AngularJS you can inject values, factories, services, providers, and constants.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions