mardi 1 décembre 2015

Reloading Model After Transition to Route

I am using Ember 2.x with a route that looks like:

  model: function(params) {
    return Ember.RSVP.hash({
      experiment: Ember.$.getJSON(config.apiServer + params.exp)
    });
  },

  setupController: function(controller, model) {
    model.reload();
    controller.set('model', model);
  }

Looking at http://ift.tt/1ICiOtg.

I tried adding setupController and an afterModel function like that above. However, when I inspect the model argument passed in the debugger, it does not have a model.reload() method (model.reload is undefined). How do I force my model to reload if this is the case?




Aucun commentaire:

Enregistrer un commentaire