I'd like to manipulate the data I get from the store object (this.store.find('...'), etc.), like limiting (I can't just send a limit to the API, since I'm just using fixtures at the moment) or reversing the result.
For limiting I've already tried to implement a limit helper and call it in the each block (#each (limit recentItems 5) ...);
import Ember from 'ember';
export default Ember.Helper.helper(function(params) {
return params[0].slice(0, params[1]);
});
I don't know exactly why it didn't work, but it seems that the result object is not an array and therefore I'm not able to slice it. Same goes for reverting.
Thanks.
Aucun commentaire:
Enregistrer un commentaire