I want to declare two models to be loaded by my controller.
I am not using the model,beforeModel, or afterModel hooks because:
- I don't have to implement
loadingroutes/templates - I can load each model independently in the page (like lazy loading)
I am using the setupController hook in my route as so:
setupController: function(controller, model) {
var that = this;
controller.set('model', {
stations: that.store.find('station'),
packages: that.store.find('package'),
});
}
My controller is an Ember.Controller.
In order to iterate through these models in Handlebars I have to use model.stations.content.content which makes me think I am doing something wrong:
{{#each station in model.stations.content.content}}
// .....
{{/each}}
Is there a better way to set these models on the controller or use a different controller type or something?