I'm beginning to work with ember-data and I have a problem to map the data
Here an exemple of my code ( i've place a jsonTest as an exemple of the data received from de backend , I don't work on the backend and I cannot modify the response from the server )
Clive = Ember.Application.create();
// MODEL
Clive.Deadline = DS.Model.extend({
title : DS.attr('string'),
});
jsonTest = '{"items":[{"id":93,"title":"title","date":"14-11-2012"}]}';
// Adapter
Clive.adapter = DS.Adapter.create({
findAll : function(store,type){
var self = this;
self.didFindAll(store, type, jsonTest);
}
});
Clive.store = DS.Store.create({
revision: 11,
adapter: 'Clive.adapter'
});
Clive.deadlineList = Clive.Deadline.find().get('items');
When I run the code I have this error :
Uncaught Error: assertion failed: Your server returned a hash with the key 0 but you have no mapping for it
Here a jsfidlle with the exemple : http://jsfiddle.net/gilles/6D5BC/