@@ -25,15 +25,16 @@ events:
2525
2626In the illustration above, the dependency injection sequence proceeds as follows:
2727
28- 1. Service factory functions are registered with angular's service factory repository.
29- 2. `ng:app` triggers angular's bootstrap sequence, during which angular compiles the template,
30- creates the root scope, and creates the dependency injector.
31- 3. The `ng:controller` directive implicitly creates a new child scope, augmented by the application
32- of the `PhoneListCtrl` controller function.
33- 4. The Injector identifies the `$xhr` service as `PhoneListCtrl` controller's only dependency.
34- 5. The Injector checks if the `$xhr` service has already been instantiated, and if not uses the
35- factory function from the service factory repository to construct it.
36- 6. DI provides the instance of $xhr service to the PhoneListCtrl controller constructor
28+ 1. Module "phonecat" is created and all the service providers are registered with this module.
29+ (the "ng" module is created by Angular behind the scenes as well)
30+ 2. `ng:app` triggers bootstrap sequence on given element, during which angular creates injector,
31+ loads "phonecat" and "ng" modules and compiles the template.
32+ 3. The `ng:controller` directive implicitly creates a new child scope and instantiates
33+ `PhoneListCtrl` controller.
34+ 4. Injector identifies the `$http` service as `PhoneListCtrl` controller's only dependency.
35+ 5. Injector checks its instances cache whether the `$http` service has already been instantiated.
36+ If not uses the provider from the available modules to construct it.
37+ 6. Injector provides the instance of `$http` service to the `PhoneListCtrl` controller constructor.
3738
3839
3940## How Scope Relates to DI
0 commit comments