mardi 3 novembre 2015

setupController no longer working for Ember route

I can not longer setup a route that has a hash of multiple models. What I use to do is this:

import Ember from 'ember';

export default Ember.Route.extend({

  model() {
    return Ember.RSVP.hash({
      products: this.store.findAll('product'),
      suppliers: this.store.findAll('supplier')
    });
  },
  setupController(controller, model) {
    controller.set('products', model.products);
    controller.set('suppliers', model.suppliers);
  }

});

When I do this I can't loop through each {{#each products}} but I still can with {{#each model.products}}




Aucun commentaire:

Enregistrer un commentaire