21. Understanding AngularJS Modules and Dependency Injection

One of the most important aspects of AngularJS to understand is dependency injection and how it relates to modules. Dependency is a common concept across many server-side languages but has not really been implemented much in JavaScript until AngularJS.

Dependency injection allows AngularJS modules to maintain a very clean, organized form and yet more easily access functionality from other modules. When implemented correctly, it also tends to reduce the amount of code by a considerable amount.

This chapter provides a basic overview of dependency injection and then describes how to create modules that provide functionality and how to consume that functionality in other modules as well as other AngularJS components, such as controllers.

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

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