diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/content/tutorial/step_08.ngdoc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/docs/content/tutorial/step_08.ngdoc b/docs/content/tutorial/step_08.ngdoc index 5075be98..968c9add 100644 --- a/docs/content/tutorial/step_08.ngdoc +++ b/docs/content/tutorial/step_08.ngdoc @@ -61,12 +61,14 @@ the same way as the phone list controller. __`app/js/controllers.js`:__ <pre> -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; - }); -}]); +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; + }); + }]); </pre> To construct the URL for the HTTP request, we use `$routeParams.phoneId` extracted from the current |
