From 8ec7668131b4de727400088bf2603457d57eb581 Mon Sep 17 00:00:00 2001 From: Brian Ford Date: Fri, 11 Oct 2013 16:05:27 -0700 Subject: docs(tutorial/step10): use DI annotations --- docs/content/tutorial/step_10.ngdoc | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'docs/content') diff --git a/docs/content/tutorial/step_10.ngdoc b/docs/content/tutorial/step_10.ngdoc index 9e629861..fef006c9 100644 --- a/docs/content/tutorial/step_10.ngdoc +++ b/docs/content/tutorial/step_10.ngdoc @@ -25,17 +25,19 @@ GitHub}: __`app/js/controllers.js`:__
 ...
-var phonecatApp = angular.module('phonecatApp',[]);
-phonecatApp.controller('PhoneDetailCtrl', ['$scope', '$routeParams', '$http', function($scope, $routeParams, $http) {
-  $http.get('phones/' + $routeParams.phoneId + '.json').success(function(data) {
-    $scope.phone = data;
-    $scope.mainImageUrl = data.images[0];
-  });
+var phonecatControllers = angular.module('phonecatControllers',[]);
+
+phonecatControllers.controller('PhoneDetailCtrl', ['$scope', '$routeParams', '$http',
+  function($scope, $routeParams, $http) {
+    $http.get('phones/' + $routeParams.phoneId + '.json').success(function(data) {
+      $scope.phone = data;
+      $scope.mainImageUrl = data.images[0];
+    });
 
-  $scope.setImage = function(imageUrl) {
-    $scope.mainImageUrl = imageUrl;
-  }
-}]);
+    $scope.setImage = function(imageUrl) {
+      $scope.mainImageUrl = imageUrl;
+    }
+  }]);
 
In the `PhoneDetailCtrl` controller, we created the `mainImageUrl` model property and set its @@ -133,7 +135,7 @@ template remains operational. # Summary -With the phone image swapper in place, we're ready for {@link step_11 step 11} (the last step!) to +With the phone image swapper in place, we're ready for {@link step_11 step 11} to learn an even better way to fetch data. -- cgit v1.2.3