aboutsummaryrefslogtreecommitdiffstats
path: root/docs/content/tutorial/step_08.ngdoc
diff options
context:
space:
mode:
authorBrian Ford2013-10-11 16:04:20 -0700
committerBrian Ford2013-10-11 16:15:36 -0700
commita61d7999a4857871c2e2f73760d85ca6ab747858 (patch)
tree202bdb0d0677a1fb82122033c4d7c687d0e9bbcc /docs/content/tutorial/step_08.ngdoc
parent01cbe2f3982bd91fdae9fcbbde833a5306b2042d (diff)
downloadangular.js-a61d7999a4857871c2e2f73760d85ca6ab747858.tar.bz2
docs(tutorial/step08): use DI annotations
Diffstat (limited to 'docs/content/tutorial/step_08.ngdoc')
-rw-r--r--docs/content/tutorial/step_08.ngdoc14
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