Closed Maelstromeous closed 8 years ago
Investigated using the $http
promise directly, it appears that $http
itself, in Angular, is a promise. When the http request has been successful, it returns itself the resolve()
method into the then()
callback. The .then()
is then passing back the successful data.
There is a function for .error()
by what looks to be seemly using reject()
part of promise.
In my code, I'm using a promise.all
, so I can't simply return the $http promise
as the all promise requires all subpromises to resolve.
No need to wrap a promise within a promise. $http returns a promise itself.