
Dependency Injector
Service Factories
$http, $log,
$timeout,
$q, ...
2
The Injector idenes $hp
service as a dependency of
PhoneListCtrl
The Injector checks whether $hp
has already been instanated.
The Injector provides the singleton
instance of the $hp service to the
PhoneListCtrl controller.
phonecatControllers.controller('PhoneListCtrl
',
function($scope, $http) {
...
}]
);
1
4
Service Instances
$http, $log,
$timeout,
$q, ...
If not, the Injector uses a factory
funcon for $hp to construct it.
3