jeudi 9 juillet 2015

How to sort model using only a route in ember?

In the past you could use ArrayControllers (deprecated in 1.13.0), and we know that shortly controllers won't be recommended in ember. Is it currently possible to sort my model using only my route?

i.e

/routes/orders.js

import Ember from 'ember';

export default Ember.Route.extend({
  model: function() { return this.store.findAll('order'); }
});

How would I sort by 'name' as an example, but only using a route?

Note that this question is similar to How to sort model in Ember.js? - but there it is via any method, whereas my question is specific to doing it only using a route (if possible).




Aucun commentaire:

Enregistrer un commentaire