8000 docs(tutorial/step08): use DI annotations · olostan/angular.js@a61d799 · GitHub
[go: up one dir, main page]

Skip to content

Commit a61d799

Browse files
committed
docs(tutorial/step08): use DI annotations
1 parent 01cbe2f commit a61d799

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

docs/content/tutorial/step_08.ngdoc

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,14 @@ the same way as the phone list controller.
6161

6262
__`app/js/controllers.js`:__
6363
<pre>
64-
var phonecatApp = angular.module('phonecatApp',[]);
65-
phonecatApp.controller('PhoneDetailCtrl', ['$scope', '$routeParams', '$http', function($scope, $routeParams, $http) {
66-
$http.get('phones/' + $routeParams.phoneId + '.json').success(function(data) {
67-
$scope.phone = data;
68-
});
69-
}]);
64+
var phonecatControllers = angular.module('phonecatControllers',[]);
65+
66+
phonecatControllers.controller('PhoneDetailCtrl', ['$scope', '$routeParams', '$http',
67+
function($scope, $routeParams, $http) {
68+
$http.get('phones/' + $routeParams.phoneId + '.json').success(function(data) {
69+
$scope.phone = data;
70+
});
71+
}]);
7072
</pre>
7173

7274
To construct the URL for the HTTP request, we use `$routeParams.phoneId` extracted from the current

0 commit comments

Comments
 (0)
0