lundi 2 mars 2015

Ember.js: How to get meta data of multiple requests to same url

I am populating my page with data of multiple models like so:


index route:



model: function() {
return Ember.RSVP.hash({
books: this.store.find('book', {order: 'new'}),
featuredList: this.store.find('list', {type: 'featured'}),
recommendedList: this.store.find('list', {type: 'recomended'}),
});
}


As you can see, two of the requests are made to same data source: list


And I need to get the meta data of the last two requests. Currently, I can only get meta data only on the last request like below:


index controller:



export default Ember.Controller.extend({
listMeta: function() {
return Ember.copy(this.store.metadataFor('list'));
}.property()
});


How can I get the meta data of both requests to list?





Aucun commentaire:

Enregistrer un commentaire