Okay, I can't stand anything like resource, plain http, restangular, restmod, breezejs etc.

I need good(in my opinion) library to work with REST API, which has paginated, sortable, nested resources and some additional resource/collection methods. That's all we need, anyone needs to forget about writing crappy code in this part of project.

All I actually need is described here:

  1. Model class should be able to have instance methods: user.deactivate(). It is easy to extend resource object prototype, so it is fine. Every library can do it.
  2. Model class should have method to get collection of data: User.findAll(active:true). Trivial, every library can do it, but not all can support get-params in easy way.
  3. Model class should support relations: if I said user field of Document object is User, it should be User intance after retrieving: doc.user.get_karma(). Rarely libraries support this thing. Yea, we can add interceptor to do it manualy, but... it is essential, damn.
  4. Model Collection should be able to have instance methods: users.delete(). Simple, isn't it? Most libs return simple array.
  5. Model Collection should be able to support array or object data(paginated/non paginated). Even resource supports it.
  6. Model Collection should be able to be paginated in same instance: coll.goPage(3). Backbone.Pagination has solid solution.
  7. Model Collection should be able to be ordered by fields(server-side) in same instance: coll.orderBy('name'). Same, Backbone has it.
  8. Model Collection shoud have method to filter it's data by new filters(to extend filters and resync data): coll2 = coll.filter(age: 10). Main reason I cannot stop at Backbone.Model.

Read before commenting!!! There is nothing superior in these features and it is common things we need in any project or even simple app, so there should be common solutions which has all this basic things solved together, right?

Is there at least ONE library, which does all this things?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.