Dependency Injector
Service Factories
$http, $log,
$timeout, $q,
...
2
The Injector identifies $http
service as a dependency of
PhoneListCtrl
The Injector checks whether $http
has already been instantiated.
The Injector provides the singleton
instance of the $http 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
function for $http to construct it.
3