问题
I am getting the following error when i change attributes of a model.
Uncaught Error: <DS.StateManager:ember466> could not respond to event setProperty in state rootState.loading.
Here is the code. http://jsfiddle.net/arenoir/JejwD/ http://jsfiddle.net/arenoir/JejwD/show
回答1:
Since revision 6 of ember-data (see breaking changes), IDs are string-normalized. As a result, you'll need to update your fixtures to use strings for IDs (note: the REST adapter will convert numbers/strings, but the fixture adapter doesn't do any conversions).
Making the following changes to your fixtures seems to get your example working:
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']}
];
See http://jsfiddle.net/dgeb/GVU7n/
来源:https://stackoverflow.com/questions/13296022/my-computed-values-stopped-working-with-latest-version-of-ember-data-js