jakubrohleder / angular-jsonapi

Simple and lightweight, yet powerful ORM for your frontend that seamlessly integrates with your JsonAPI server.
http://jakubrohleder.github.io/angular-jsonapi/
GNU General Public License v3.0
95 stars 34 forks source link

There's no way to access a promise #5

Closed hedder closed 9 years ago

hedder commented 9 years ago

I am using resource.all(params) to fetch a list of objects.

However, I can not access the promise of this request. Is it possible to expose promise as a method like angular resource does it, for example.

jakubrohleder commented 9 years ago

The same problem occurs with resource.get(id, params).

This one is actually already at the 1.0.0-alpha.3 milestone tasks list. I got two ideas how to expose promise:

I personally lean towards first option (without $, just to be consistent with the rest of the API). It's easiest to implement and does not lock on the $route (and ui-router) resolve. The second option is quite cool, but despite unobvious meaning of .then it locks on the resolve.

Uhh.. Long story short: If you do not disagree with my opinion this option will be added in the 1.0.0-alpha.3 as resource.all(params).promise.then(resolve, reject)....

hedder commented 9 years ago

resource.all(params).promise.then makes perfect sense.

hedder commented 9 years ago

Fixed