3
我試圖使用Ember Data加載模型。 AJAX調用,以獲取模型似乎是成功的,但我得到以下Ember Data:數據散列已加載...但未提供主鍵「未定義」
Uncaught Error: assertion failed: A data hash was loaded for a model of type App.Account but no primary key 'undefined' was provided.
在燼-data.js:1128它似乎deferencing未定義的PrimaryKey的,而不是默認爲「身份證」,當一個模型不指定primaryKey。但我也試圖明確primaryKey沒有效果。
爲了完整起見,這裏是我的模型:
App.Account = DS.Model.extend({ portfolio_id: DS.attr('integer'), title: DS.attr('string'), user_id: DS.attr('integer'), url: 'investment_account' });
,我加載帳戶具有如下:
App.store.find(App.Account, account_id)
任何想法?
我使用-latest這兩個燼和燼數據都遇到了同樣的問題。 –