File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -1023,18 +1023,18 @@ angular.mock.dump = function(object) {
1023
1023
function MyController($scope, $http) {
1024
1024
var authToken;
1025
1025
1026
- $http.get('/auth.py').success (function(data, status, headers ) {
1027
- authToken = headers('A-Token');
1028
- $scope.user = data;
1026
+ $http.get('/auth.py').then (function(response ) {
1027
+ authToken = response. headers('A-Token');
1028
+ $scope.user = response. data;
1029
1029
});
1030
1030
1031
1031
$scope.saveMessage = function(message) {
1032
1032
var headers = { 'Authorization': authToken };
1033
1033
$scope.status = 'Saving...';
1034
1034
1035
- $http.post('/add-msg.py', message, { headers: headers } ).success (function(response) {
1035
+ $http.post('/add-msg.py', message, { headers: headers } ).then (function(response) {
1036
1036
$scope.status = '';
1037
- }).error (function() {
1037
+ }).catch (function() {
1038
1038
$scope.status = 'Failed...';
1039
1039
});
1040
1040
};
You can’t perform that action at this time.
0 commit comments