aboutsummaryrefslogtreecommitdiffstats
path: root/docs/content/tutorial/step_05.ngdoc
diff options
context:
space:
mode:
authorBrian Ford2013-10-08 10:45:00 -0700
committerBrian Ford2013-10-08 10:49:33 -0700
commit556e8eece69b93b89c6ae1cc4cb86d08994a0dfc (patch)
treee797331ff844daf220327f43a0ad5a0a0bbe64f0 /docs/content/tutorial/step_05.ngdoc
parentd769b8b8f0fba81b35e441249e31e7e209d40580 (diff)
downloadangular.js-556e8eece69b93b89c6ae1cc4cb86d08994a0dfc.tar.bz2
docs(tutorial): fix style across tutorial steps
Diffstat (limited to 'docs/content/tutorial/step_05.ngdoc')
-rw-r--r--docs/content/tutorial/step_05.ngdoc11
1 files changed, 5 insertions, 6 deletions
diff --git a/docs/content/tutorial/step_05.ngdoc b/docs/content/tutorial/step_05.ngdoc
index 36d4748c..80c7a96f 100644
--- a/docs/content/tutorial/step_05.ngdoc
+++ b/docs/content/tutorial/step_05.ngdoc
@@ -54,16 +54,15 @@ components themselves, but by the DI subsystem).
__`app/js/controllers.js:`__
<pre>
-function PhoneListCtrl($scope, $http) {
+var phonecatApp = angular.module('phonecatApp', []);
+
+phonecatApp.controller('PhoneListCtrl', function PhoneListCtrl($scope) {
$http.get('phones/phones.json').success(function(data) {
$scope.phones = data;
});
$scope.orderProp = 'age';
-}
-
-var phonecatApp = angular.module('phonecatApp',[]);
-phonecatApp.controller('PhoneListCtrl', PhoneListCtrl);
+});
</pre>
`$http` makes an HTTP GET request to our web server, asking for `phone/phones.json` (the url is
@@ -107,7 +106,7 @@ constructor function, if you were to {@link http://en.wikipedia.org/wiki/Minific
minify} the JavaScript code for `PhoneListCtrl` controller, all of its function arguments would be
minified as well, and the dependency injector would not be able to identify services correctly.
-There are two ways to overcome issues caused by minification.
+There are two ways to overcome issues caused by minification:
* You can create a `$inject` property on the controller function which holds an array of strings.
Each string in the array is the name of the service to inject for the corresponding parameter.