vendredi 2 octobre 2015

Params empty in model hook, but paramsFor is not empty

The example code below is how the model hook is supposed to work by default. Strangely, if I don't include the model hook at all, the model is populated correctly. If I include the model hook as below, it doesn't work because "params" is an empty object. However, this.paramsFor('somemodel') returns {somemodel_id: "1"} So, what am I missing here?

import Ember from 'ember';

export default Ember.Route.extend({
  model: function(params) {    
    return this.store.find('somemodel', params.somemodel_id);
  }
});




Aucun commentaire:

Enregistrer un commentaire