当我更改模型的属性时,我收到以下错误。
Uncaught Error: <DS.StateManager:ember466> could not respond to event setProperty in state rootState.loading.
这是代码。 http://jsfiddle.net/arenoir/JejwD/ http://jsfiddle.net/arenoir/JejwD/show
答案 0 :(得分:8)
自ember-data的修订版6(参见breaking changes)起,ID被字符串规范化。因此,您需要更新您的灯具以使用ID作为字符串(注意:REST适配器将转换数字/字符串,但灯具适配器不会进行任何转换)。
对您的灯具进行以下更改似乎让您的示例正常工作:
App.Address.FIXTURES = [
{id: '1', streetnumber: '1018', streetname: '4th Ave', city: 'Oakland', state: 'Ca'}
];
App.Job.FIXTURES = [
{id: '1', address_id: '1', customer_id: '1', name: 'bathroom addition', rate: "310", hours: "1000"}
];
App.Customer.FIXTURES = [
{id: '1', firstname: 'Mike', lastname: 'Smith', jobs: ['1']}
];