You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: docs/content/tutorial/step_05.ngdoc
+18-16Lines changed: 18 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -105,28 +105,30 @@ properties are considered private, and should not be accessed or modified.
105
105
### A Note on Minification
106
106
107
107
Since Angular infers the controller's dependencies from the names of arguments to the controller's
108
-
constructor function, if you were to [minify](http://goo.gl/SAnnsm) the JavaScript code for `PhoneListCtrl` controller, all of its function arguments would be
109
-
minified as well, and the dependency injector would not be able to identify services correctly.
108
+
constructor function, if you were to [minify](http://goo.gl/SAnnsm) the JavaScript code for
109
+
`PhoneListCtrl` controller, all of its function arguments would be minified as well, and the
110
+
dependency injector would not be able to identify services correctly.
110
111
111
-
There are two ways to overcome issues caused by minification:
112
+
We can overcome this problem by annotating the function with the names of the dependencies, provided
113
+
as strings, which will not get minified. There are two ways to provide these injection annotations:
112
114
113
-
* You can create a `$inject` property on the controller function which holds an array of strings.
115
+
* Create a `$inject` property on the controller function which holds an array of strings.
114
116
Each string in the array is the name of the service to inject for the corresponding parameter.
0 commit comments