docs(guide): update description of $inject mechanism to be a little clearer

This commit is contained in:
phanboy4 2013-08-12 16:27:15 -04:00 committed by Brian Ford
parent e86de0db56
commit c7b0d8494d

View file

@ -147,6 +147,8 @@ of service names to inject.
MyController.$inject = ['$scope', 'greeter'];
</pre>
In this scenario the ordering of the values in the '$inject' array must match the ordering of the arguments to inject.
Using above code snippet as an example, '$scope' will be injected into 'renamed$scope' and 'greeter' into 'renamedGreeter'.
Care must be taken that the `$inject` annotation is kept in sync with the actual arguments in the
function declaration.