There is a service that makes a request through $http , in the processing of a request (no matter resolve or reject ), I return some data through return , as a result, the service returns a promise , like (let's say in the controller where I called this service) check on the request was resolve or reject ?
Service example:
return $http(option) .then(onResolve,onReject); An example of a service call:
reguestService({ url: `someUrl`, method: 'get', }).then(function (response) { // Как тут узнать был ли запрос успешным или нет ? });
return $http(option) .then(onResolve,onReject);- Grundy