mardi 12 décembre 2017

EmberJS - Printing model properties when multiple models on a route

I currently have two models being loaded from the same route using the following code:

    model(params) {
    return Ember.RSVP.hash({
      sginp: this.get('store').query('sginp', params),
      weekdayplan: this.get('store').query('weekdayplan', params),
        });
  },

  setupController(controller, models) {
    controller.set('sginp', models.sginp);
    controller.set('weekdayplan', models.weekdayplan);

  }

Both of the models load correctly in Ember Data.

I would like to be able to display the values of different model properties in different parts of my page.

As per a previous question I have been doing this with when I have had one single model and it works fine.

I assumed I would be able to do something like:

 
 

But these (and a number of permutations) do not display anything when used and no errors are generated in the console.




Aucun commentaire:

Enregistrer un commentaire