Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

docs(tutorial/step-5): .success has been deprecated #13632

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/content/tutorial/step_05.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});

Expand All @@ -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!
Expand Down Expand Up @@ -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;
});

Expand Down
2 changes: 1 addition & 1 deletion docs/content/tutorial/step_07.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});

Expand Down
2 changes: 1 addition & 1 deletion docs/content/tutorial/step_08.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
}]);
Expand Down
2 changes: 1 addition & 1 deletion docs/content/tutorial/step_10.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -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];
});
Expand Down
2 changes: 1 addition & 1 deletion docs/content/tutorial/step_11.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});

Expand Down