A pattern I’ve found myself using a lot is when I need to load multiple models in a single route. This is usually due to a form that needs collections of data to present a choice to the user (a drop down, checkboxes, etc). I’ve typically implemented it using an
Ember.RSVP.hash as the route’s model, and then
setupController to cherry pick the properties and set them on the controller. See http://emberjs.jsbin.com/zirot/5/edit for an example of this pattern.
I’ve done this enough times now, that I’d like to do it all in one step, rather than needing setup controller. I’ve come up with a solution I think I like, and spiked an implementation tonight. Here’s the same example using my
Ember.PromiseModel solution: http://emberjs.jsbin.com/zirot/4/edit.
How do others handle this case? Would this be useful to anyone else?