3
我有這樣的選擇視圖從服務器加載的值:綁定Ember.select到
App.sectors = ["Alpinism", "Climbing", "Kayaking];
{{view Ember.Select contentBinding="App.sectors"}}
現在,而不是固定值的向量,我想有填充值來自的選擇視圖服務器;換句話說,我想這樣做:
App.sectors = function() {
return this.store.find('sector');
}
但這不起作用,因爲灰燼說我必須通過一個載體contentBinding而不是功能...
(我有部門模型定義:
App.Sector = DS.Model.extend({
description: DS.attr('string')
});
和我的寧靜服務器的答案正確就「域/部門」)
太好了!非常感謝;) –
你還可以告訴我如何設置Ember Select View的默認選定值嗎? –