Skip to content

Commit 8ec7668

Browse files
committed
docs(tutorial/step10): use DI annotations
1 parent a61d799 commit 8ec7668

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

docs/content/tutorial/step_10.ngdoc

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,19 @@ GitHub}:
2525
__`app/js/controllers.js`:__
2626
<pre>
2727
...
28-
var phonecatApp = angular.module('phonecatApp',[]);
29-
phonecatApp.controller('PhoneDetailCtrl', ['$scope', '$routeParams', '$http', function($scope, $routeParams, $http) {
30-
$http.get('phones/' + $routeParams.phoneId + '.json').success(function(data) {
31-
$scope.phone = data;
32-
$scope.mainImageUrl = data.images[0];
33-
});
28+
var phonecatControllers = angular.module('phonecatControllers',[]);
29+
30+
phonecatControllers.controller('PhoneDetailCtrl', ['$scope', '$routeParams', '$http',
31+
function($scope, $routeParams, $http) {
32+
$http.get('phones/' + $routeParams.phoneId + '.json').success(function(data) {
33+
$scope.phone = data;
34+
$scope.mainImageUrl = data.images[0];
35+
});
3436

35-
$scope.setImage = function(imageUrl) {
36-
$scope.mainImageUrl = imageUrl;
37-
}
38-
}]);
37+
$scope.setImage = function(imageUrl) {
38+
$scope.mainImageUrl = imageUrl;
39+
}
40+
}]);
3941
</pre>
4042

4143
In the `PhoneDetailCtrl` controller, we created the `mainImageUrl` model property and set its
@@ -133,7 +135,7 @@ template remains operational.
133135

134136
# Summary
135137

136-
With the phone image swapper in place, we're ready for {@link step_11 step 11} (the last step!) to
138+
With the phone image swapper in place, we're ready for {@link step_11 step 11} to
137139
learn an even better way to fetch data.
138140

139141

0 commit comments

Comments
 (0)