Disallow the $http success and error function. Instead the standard promise API should be used.
Rule based on Angular 1.x
The following patterns are considered problems;
/*eslint angular/no-http-callback: 2*/
// invalid
$http.get('api/data').success(function onSuccess() {
// ...
}); // error: $http success is deprecated. Use then instead
// invalid
$http.get('api/data').error(function onReject() {
// ...
}); // error: $http error is deprecated. Use then or catch instead
The following patterns are not considered problems;
/*eslint angular/no-http-callback: 2*/
// valid
$http.get('api/data').then(function onSuccess() {
// ...
}, function onReject() {
// ...
});
This rule was introduced in eslint-plugin-angular 0.12.0