docs(tutorial/step08): use DI annotations

This commit is contained in:
Brian Ford 2013-10-11 16:04:20 -07:00
parent 01cbe2f398
commit a61d7999a4

View file

@ -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