dimanche 4 mars 2018

Router passing wrong model to setupController

If anyone familiar with that I have route:

export default Route.extend({
  model: function (params) {
    return Ember.RSVP.hash({
      'category': this.store.peekRecord('category', params.id)
    });
  },
  setupController: function(controller, model) {
    console.log('---',model);
    this._super(controller, model);
  }
});

When route executing I receive strange behavior:

  • first load works fine, model contain {category: my model Class}

  • second reloading of this route return only model Class without category key.

Environment:

  • Ember : 3.0.0

  • Ember Data : 3.0.1




Aucun commentaire:

Enregistrer un commentaire