[I'm on Ember 1.0.0 - Ember.data 0.13]
In a nested route I'm using the setupController
hook in order to load a list of templates which I use as selection list for my model, a Offer
object:
controller.set('offerTemplates', App.OfferTemplate.find());
Complete code:
App.OfferEditRoute = Ember.Route.extend({
model: function () {
return this.modelFor("offer");
},
setupController: function (controller, model) {
controller.set('content', model);
controller.set('offerTemplates', App.OfferTemplate.find());
},
renderTemplate: function () {
this.render('offer-edit-title', { into: 'application', outlet: 'page-title', controller: 'offerEdit' });
this.render('offer-edit', { into: 'application', controller: "offerEdit" }); //
}
});
App.OfferEditController = Ember.ObjectController.extend({
offerTemplates: [],
...
)};
This used to work until Ember 1 RC 7, but doesn't in 1.0.0. The main content of the Offer
(model) is correctly rendered, but the template list bound to the controller's offerTemplates
property (array) is not rendered on loading the page (browser page refresh).
If I switch page and back to the route, all is rendered correctly.
Any hint?
App.__container__.lookup("controller:offerEdit").get("offerTemplates.length")
– mavilein