Summary

Dependency injection allows you to define provider functionality that can be injected into other AngularJS components. The provider functionality is contained inside modules and registered with an injector service. Providers define how to build the functionality so that when another component defines a dependency on a provider, an instance of the provider object can be created and injected.

AngularJS provides a fairly robust dependency injection model that allows you to define different types of service providers. Using dependency injection rather than global definitions makes your code more modularized and easier to maintain. In this chapter you’ve been introduced to the dependency injection model and have seen how to implement it in both modules and a controller component.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.7.13