AngularJS Developer Question:
Download Questions PDF

Explain me what is dependency injection and how does it work?

Answer:

AngularJS was designed to highlight the power of dependency injection, a software design pattern that places an emphasis on giving components their dependencies instead of hard coding 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.

Download AngularJS Developer Interview Questions And Answers PDF

Previous QuestionNext Question
Tell me how does the digest phase work?Explain what are the characteristics of “Scope”?