[私は Ember 1.0.0 - Ember.data 0.13 を使用しています]
ネストされたルートではsetupController
、モデル、Offer
オブジェクトの選択リストとして使用するテンプレートのリストをロードするためにフックを使用しています:
controller.set('offerTemplates', App.OfferTemplate.find());
完全なコード:
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: [],
...
)};
これは Ember 1 RC 7 までは機能していましたが、1.0.0 では機能しません。(モデル)のメイン コンテンツOffer
は正しくレンダリングされますが、コントローラーのofferTemplates
プロパティ (配列) にバインドされたテンプレート リストは、ページの読み込み (ブラウザー ページの更新) 時にレンダリングされません。
ページを切り替えてルートに戻ると、すべてが正しくレンダリングされます。
ヒントはありますか?