diff --git a/docs/content/tutorial/step_05.ngdoc b/docs/content/tutorial/step_05.ngdoc index fd7135cc6f8a..29b3ac42bdf7 100644 --- a/docs/content/tutorial/step_05.ngdoc +++ b/docs/content/tutorial/step_05.ngdoc @@ -54,7 +54,7 @@ __`app/js/controllers.js:`__ var phonecatApp = angular.module('phonecatApp', []); phonecatApp.controller('PhoneListCtrl', function ($scope, $http) { - $http.get('phones/phones.json').success(function(data) { + $http.get('phones/phones.json').then(function(data) { $scope.phones = data; }); @@ -68,7 +68,7 @@ relative to our `index.html` file). The server responds by providing the data in browser and our app they both look the same. For the sake of simplicity we used a json file in this tutorial.) -The `$http` service returns a {@link ng.$q promise object} with a `success` +The `$http` service returns a {@link ng.$q promise object} with a `then` method. We call this method to handle the asynchronous response and assign the phone data to the scope controlled by this controller, as a model called `phones`. Notice that Angular detected the json response and parsed it for us! @@ -150,7 +150,7 @@ var phonecatApp = angular.module('phonecatApp', []); phonecatApp.controller('PhoneListCtrl', ['$scope', '$http', function ($scope, $http) { - $http.get('phones/phones.json').success(function(data) { + $http.get('phones/phones.json').then(function(data) { $scope.phones = data; }); diff --git a/docs/content/tutorial/step_07.ngdoc b/docs/content/tutorial/step_07.ngdoc index 824e322d3e48..2f87c1dd5231 100644 --- a/docs/content/tutorial/step_07.ngdoc +++ b/docs/content/tutorial/step_07.ngdoc @@ -280,7 +280,7 @@ var phonecatControllers = angular.module('phonecatControllers', []); phonecatControllers.controller('PhoneListCtrl', ['$scope', '$http', function ($scope, $http) { - $http.get('phones/phones.json').success(function(data) { + $http.get('phones/phones.json').then(function(data) { $scope.phones = data; }); diff --git a/docs/content/tutorial/step_08.ngdoc b/docs/content/tutorial/step_08.ngdoc index 6e5ef9abd8f7..f1ed6c1b140b 100644 --- a/docs/content/tutorial/step_08.ngdoc +++ b/docs/content/tutorial/step_08.ngdoc @@ -63,7 +63,7 @@ var phonecatControllers = angular.module('phonecatControllers',[]); phonecatControllers.controller('PhoneDetailCtrl', ['$scope', '$routeParams', '$http', function($scope, $routeParams, $http) { - $http.get('phones/' + $routeParams.phoneId + '.json').success(function(data) { + $http.get('phones/' + $routeParams.phoneId + '.json').then(function(data) { $scope.phone = data; }); }]); diff --git a/docs/content/tutorial/step_10.ngdoc b/docs/content/tutorial/step_10.ngdoc index fd073a5c9d41..42783bb4a9a2 100644 --- a/docs/content/tutorial/step_10.ngdoc +++ b/docs/content/tutorial/step_10.ngdoc @@ -24,7 +24,7 @@ var phonecatControllers = angular.module('phonecatControllers',[]); phonecatControllers.controller('PhoneDetailCtrl', ['$scope', '$routeParams', '$http', function($scope, $routeParams, $http) { - $http.get('phones/' + $routeParams.phoneId + '.json').success(function(data) { + $http.get('phones/' + $routeParams.phoneId + '.json').then(function(data) { $scope.phone = data; $scope.mainImageUrl = data.images[0]; }); diff --git a/docs/content/tutorial/step_11.ngdoc b/docs/content/tutorial/step_11.ngdoc index 946a7185ecd0..a9d95c36392e 100644 --- a/docs/content/tutorial/step_11.ngdoc +++ b/docs/content/tutorial/step_11.ngdoc @@ -148,7 +148,7 @@ phonecatControllers.controller('PhoneDetailCtrl', ['$scope', '$routeParams', 'Ph Notice how in `PhoneListCtrl` we replaced: - $http.get('phones/phones.json').success(function(data) { + $http.get('phones/phones.json').then(function(data) { $scope.phones = data; });