lundi 29 décembre 2014

How to fetch all data in one request in Ember Data?

I am using the ember 1.8.1, ember data 1.0.0-beta 11. I have two types name A and B the relationship is like



A = DS.Model.extend({
bs: DS.hasMany('B', {async: true})
});
B = DS.Model.extend({
a: DS.belongsTo('A')
});


According this post: http://thau.me/2014/09/ember-data-mastering-async-relationships/


When I try to fetch the bs in a.model in template like this: {{#each b in model.bs}}


The ember's RESTAdapter will send a http request like this: URL/bs?ids[]=1&ids[]=2


But it will send several request like this: URL/b/1 URL/b/2


Is the behavior of ember data changed in new version? How can I combine the requests to 1 request?





Aucun commentaire:

Enregistrer un commentaire