docs(guide): fix injector service code example

Fix syntax and update code to the latest API
This commit is contained in:
Romain Neutron 2012-12-06 01:35:37 +01:00 committed by Pawel Kozlowski
parent c398d7d370
commit a66c968df2

View file

@ -67,11 +67,11 @@ Here is an example of using the injector service.
$window.alert(text); $window.alert(text);
} }
}; };
}). });
// New injector is created from the module. // New injector is created from the module.
// (This is usually done automatically by angular bootstrap) // (This is usually done automatically by angular bootstrap)
var injector = angular.injector('myModule'); var injector = angular.injector(['myModule', 'ng']);
// Request any dependency from the injector // Request any dependency from the injector
var greeter = injector.get('greeter'); var greeter = injector.get('greeter');