mercredi 3 juin 2015

Working with Embedded Records and Ember Data

I am working with Ember and Ember Data, and the JSON I get back from the server contains an embedded object array. I need to know what I am doing wrong. I have a JSBin with the code below:

http://ift.tt/1G5Iws4

Currently, I am getting the following error:

Error while processing route: index Assertion Failed: Ember Data expected a number or string to represent the record(s) in the objects relationship instead it found an object. If this is a polymorphic relationship please specify a type key. If this is an embedded relationship please include the DS.EmbeddedRecordsMixin and specify the objects property in your serializer's attrs object. Error: Assertion Failed: Ember Data expected a number or string to represent the record(s) in the objects relationship instead it found an object. If this is a polymorphic relationship please specify a type key. If this is an embedded relationship please include the DS.EmbeddedRecordsMixin and specify the objects property in your serializer's attrs object.

I am using DS.EmbeddedRecordsMixin in my serializer, but it doesn't seem to be working. How can I use that JSON with Ember Data?




Aucun commentaire:

Enregistrer un commentaire