From c6016a6a85780ae68f71bbdd0eea391977225b7e Mon Sep 17 00:00:00 2001 From: victorbjelkholm Date: Mon, 14 Oct 2013 23:25:00 +0200 Subject: docs(tutorial): change controllers to not have name twice While giving the controller function a name helps with debugging, since otherwise your controller will be anonymous in stack traces, passing the name to both the `controller()` method and as the function name is confusing for beginners. Closes #4415 --- docs/content/tutorial/step_05.ngdoc | 6 +++--- 1 file changed, 3 insertions(+), 3 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 c9ffeded..d7e06a6f 100644 --- a/docs/content/tutorial/step_05.ngdoc +++ b/docs/content/tutorial/step_05.ngdoc @@ -56,7 +56,7 @@ __`app/js/controllers.js:`__
 var phonecatApp = angular.module('phonecatApp', []);
 
-phonecatApp.controller('PhoneListCtrl', function PhoneListCtrl($scope, $http) {
+phonecatApp.controller('PhoneListCtrl', function ($scope, $http) {
   $http.get('phones/phones.json').success(function(data) {
     $scope.phones = data;
   });
@@ -79,7 +79,7 @@ json response and parsed it for us!
 To use a service in angular, you simply declare the names of the dependencies you need as arguments
 to the controller's constructor function, as follows:
 
-    function PhoneListCtrl($scope, $http) {...}
+    phonecatApp.controller('PhoneListCtrl', function ($scope, $http) {...}
 
 Angular's dependency injector provides services to your controller when the controller is being
 constructed. The dependency injector also takes care of creating any transitive dependencies the
@@ -145,7 +145,7 @@ __`app/js/controllers.js:`__
 var phonecatApp = angular.module('phonecatApp', []);
 
 phonecatApp.controller('PhoneListCtrl', ['$scope', '$http',
-  function PhoneListCtrl($scope, $http) {
+  function ($scope, $http) {
     $http.get('phones/phones.json').success(function(data) {
       $scope.phones = data;
     });
-- 
cgit v1.2.3