mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-16 23:30:23 +00:00
docs(guide): update description of $inject mechanism to be a little clearer
This commit is contained in:
parent
bba5214930
commit
8c72549cc2
1 changed files with 2 additions and 0 deletions
|
|
@ -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.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue