What is the difference between a promise from a promise object and a promise from $ resource service

What is the difference between a promise of a promise object and a promise from a service $resource?

I know that in some cases a service is defererused to create $q, then we resolve the answer and return the promise.

Others at the same time can do something like return $resource(...).get().$promise;.

What is diff. between these two approaches?

+4
source share
1 answer

The promise returned from $resourceis the one who originally used $q.defer()(or a newer, more modern promise constructor) to create.

- $http, $resource - , .

, $q.defer - . -.

+3

All Articles