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 {{model.firstObject.property}} when I have had one single model and it works fine.
I assumed I would be able to do something like:
{{model.sginp.name}} {{model.weekdayplan.day}}
{{models.sginp.name}} {{models.weekdayplan.day}}
But these (and a number of permutations) do not display anything when used and no errors are generated in the console.
1., don't forget to call this._super(controller, models);
on the first line of setupController(controller, models)
2., in your template use some of these {{model.sginp.firstObject.name}} {{sginp.firstObject.name}} {{model.weekdayplan.firstObject.day}} {{weekdayplan.firstObject.day}}