|
13 | 13 |
|
14 | 14 | * @param {Array.<string|Function>} modules A list of module functions or their aliases. See
|
15 | 15 | * {@link angular.module}. The `ng` module must be explicitly added.
|
| 16 | + * @param {boolean=} strictDi Disallow argument name annotation inference. Defaults to false. |
16 | 17 | * @returns {injector} Injector object. See {@link auto.$injector $injector}.
|
17 | 18 | *
|
18 | 19 | * @example
|
@@ -159,7 +160,8 @@ function annotate(fn, strictDi, name) {
|
159 | 160 | *
|
160 | 161 | * In JavaScript calling `toString()` on a function returns the function definition. The definition
|
161 | 162 | * can then be parsed and the function arguments can be extracted. *NOTE:* This does not work with
|
162 |
| - * minification, and obfuscation tools since these tools change the argument names. |
| 163 | + * minification, and obfuscation tools since these tools change the argument names. This method of |
| 164 | + * discovering annotations is disallowed when the injector is in strict mode. |
163 | 165 | *
|
164 | 166 | * ## `$inject` Annotation
|
165 | 167 | * By adding an `$inject` property onto a function the injection parameters can be specified.
|
@@ -247,6 +249,8 @@ function annotate(fn, strictDi, name) {
|
247 | 249 | * This method does not work with code minification / obfuscation. For this reason the following
|
248 | 250 | * annotation strategies are supported.
|
249 | 251 | *
|
| 252 | + * This method is disallowed in strict injection mode. |
| 253 | + * |
250 | 254 | * # The `$inject` property
|
251 | 255 | *
|
252 | 256 | * If a function has an `$inject` property and its value is an array of strings, then the strings
|
@@ -296,6 +300,8 @@ function annotate(fn, strictDi, name) {
|
296 | 300 | * @param {Function|Array.<string|Function>} fn Function for which dependent service names need to
|
297 | 301 | * be retrieved as described above.
|
298 | 302 | *
|
| 303 | + * @param {boolean=} strictDi Disallow argument name annotation inference. Defaults to false. |
| 304 | + * |
299 | 305 | * @returns {Array.<string>} The names of the services which the function requires.
|
300 | 306 | */
|
301 | 307 |
|
|
0 commit comments