I want to ask about the difference about this method My concern is difference between .then and .success, function and also .error thanks.
// Simple GET request example:
$http({
method: 'GET',
url: '/someUrl'
}).then(function successCallback(response) {
// this callback will be called asynchronously
// when the response is available
}, function errorCallback(response) {
// called asynchronously if an error occurs
// or server returns response with an error status.
});
and
// Simple GET request example:
$http({
method: 'GET',
url: '/someUrl'
}).success(function successCallback(response) {
// this callback will be called asynchronously
// when the response is available
}).error( function(data) {
// called asynchronously if an error occurs
// or server returns response with an error status.
});