From 556e8eece69b93b89c6ae1cc4cb86d08994a0dfc Mon Sep 17 00:00:00 2001 From: Brian Ford Date: Tue, 8 Oct 2013 10:45:00 -0700 Subject: docs(tutorial): fix style across tutorial steps --- docs/content/tutorial/step_05.ngdoc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'docs/content/tutorial/step_05.ngdoc') 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:`__
-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);
+});
 
`$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. -- cgit v1.2.3