CHAPTER 24

image

Services for Provision and Injection

In this chapter, I describe the services that AngularJS uses behind the scenes for registering AngularJS components and injecting them to resolve dependencies. These are not features you will use in everyday projects, but they are interesting because they provide some useful insights into the way that AngularJS works behind the scenes and because they are useful for unit testing, which I describe in Chapter 25. Table 24-1 summarizes this chapter.

Table 24-1. Chapter Summary

Problem

Solution

Listing

Decorate a service.

Use the $provide.decorator method.

1

Discover the dependencies declared ...

Get Pro AngularJS now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.