2015-03-02 149 views
0

當我使用此模型時,下拉列表中有空標籤。我將標籤路徑設置爲鍵入。我的服務器返回2個車型在JSON和我看到2下拉菜單項(空)Ember視圖下拉菜單下拉菜單中有空標籤

export default DS.Model.extend({ 
    type: DS.attr('string') 
    }); 


    {{view "select" prompt="Account type" content=model optionLabelPath="type" optionValuePath="id"}} 
+0

你沒有從模型返回的id屬性,你正在給optionsValuePath作爲'id' – Vaibhav 2015-03-02 09:48:32

+0

@Vaibhav你不需要這個模型。 – SuperUberDuper 2015-03-02 09:56:39

+0

服務器返回ID – SuperUberDuper 2015-03-02 09:57:36

回答

0

它應該是:

{{視圖 「中選擇」 提示= 「賬戶類型」 內容=模型optionLabelPath =「內容.type「optionValuePath =」content.id「}}