Skip to content

Commit 07cbe8a

Browse files
Portugal, MarceloPortugal, Marcelo
authored andcommitted
fix(tutorial): Replacing .success with .then due to angular upgrade.
Also, updating usage to look for data under response.data. fix #6511
1 parent 089006f commit 07cbe8a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+169
-128
lines changed

misc/tutorial/102_sorting.ngdoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ columnDef option will cause sorting to be applied after the `cellFilters` are ap
117117
};
118118

119119
$http.get('/data/100.json')
120-
.success(function(data) {
121-
$scope.gridOptions1.data = data;
122-
$scope.gridOptions2.data = data;
120+
.then(function(response) {
121+
$scope.gridOptions1.data = response.data;
122+
$scope.gridOptions2.data = response.data;
123123
});
124124
}]);
125125
</file>

misc/tutorial/103_filtering.ngdoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,14 @@ Refer {@link 321_singleFilter singleFilter tutorial}, it is possible to implemen
166166
};
167167

168168
$http.get('/data/500_complex.json')
169-
.success(function(data) {
170-
$scope.gridOptions.data = data;
169+
.then(function(response) {
170+
$scope.gridOptions.data = response.data;
171171
$scope.gridOptions.data[0].age = -5;
172172

173-
data.forEach( function addDates( row, index ){
173+
response.data.forEach( function addDates( row, index ){
174174
row.mixedDate = new Date();
175175
row.mixedDate.setDate(today.getDate() + ( index % 14 ) );
176-
row.gender = row.gender==='male' ? '1' : '2';
176+
row.gender = row.gender === 'male' ? '1' : '2';
177177
});
178178
});
179179

misc/tutorial/104_i18n.ngdoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ For an example using angular-translate to translate your headers, refer to http:
3838
};
3939

4040
$http.get('/data/100.json')
41-
.success(function(data) {
42-
$scope.gridOptions.data = data;
41+
.then(function(response) {
42+
$scope.gridOptions.data = response.data;
4343
});
4444
}]);
4545
</file>

misc/tutorial/105_footer.ngdoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ You can override the default grid footer template with gridOptions.footerTemplat
6565
};
6666

6767
$http.get('/data/500_complex.json')
68-
.success(function(data) {
68+
.then(function(response) {
69+
var data = response.data;
70+
6971
data.forEach( function(row) {
7072
row.registered = Date.parse(row.registered);
7173
});

misc/tutorial/108_hidden_grids.ngdoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ It's all up to you. And if you know a better way then please submit it in an iss
5151
$scope.gridOptions = { };
5252

5353
$http.get('/data/100.json')
54-
.success(function(data) {
55-
$scope.gridOptions.data = data;
54+
.then(function(response) {
55+
$scope.gridOptions.data = response.data;
5656
});
5757
}]);
5858
</file>

misc/tutorial/109_multiple_grids.ngdoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ Using multiple grids on a single page
1414
$scope.gridOptions2 = {};
1515

1616
$http.get('/data/100.json')
17-
.success(function(data) {
18-
$scope.gridOptions1.data = data;
17+
.then(function(response) {
18+
$scope.gridOptions1.data = response.data;
1919
});
2020

2121
$http.get('/data/500.json')
22-
.success(function(data) {
23-
$scope.gridOptions2.data = data;
22+
.then(function(response) {
23+
$scope.gridOptions2.data = response.data;
2424
});
2525
}]);
2626
</file>

misc/tutorial/110_grid_in_modal.ngdoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ In a sense this is similar to what the auto-resize feature does, but it only doe
3333
};
3434

3535
$http.get('/data/100.json')
36-
.success(function(data) {
37-
$rootScope.gridOptions.data = data;
36+
.then(function(response) {
37+
$rootScope.gridOptions.data = response.data;
3838
});
3939

4040
$scope.showModal = function() {

misc/tutorial/111_cellClass.ngdoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ In this example, we will override the color and background for the first column
2727
};
2828

2929
$http.get('/data/100.json')
30-
.success(function(data) {
31-
$scope.gridOptions.data = data;
30+
.then(function(response) {
31+
$scope.gridOptions.data = response.data;
3232
});
3333
}]);
3434
</file>

misc/tutorial/113_adding_and_removing_columns.ngdoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ def properties), and call the notifyDataChange api to force an update.
5656
}
5757

5858
$http.get('/data/100.json')
59-
.success(function(data) {
60-
$scope.gridOptions.data = data;
59+
.then(function(response) {
60+
$scope.gridOptions.data = response.data;
6161
});
6262
}]);
6363
</file>

misc/tutorial/114_row_header.ngdoc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ You can add a row header column, which goes into the left pinned container
2323
};
2424

2525
$http.get('/data/100.json')
26-
.success(function(data) {
27-
$scope.gridOptions.data = data;
28-
console.log(data)
26+
.then(function(response) {
27+
$scope.gridOptions.data = response.data;
2928
});
3029
}]);
3130
</file>

0 commit comments

Comments
 (0)