ember-model icon indicating copy to clipboard operation
ember-model copied to clipboard

Response data.map() doesn't seem to exist

Open silvenon opened this issue 11 years ago • 7 comments

This is possibly my mistake, but I'm having a hard time getting the response data processed with materializeData, because data doesn't have a map method. Where is it getting it from? (Btw, I love how I can actually read the source code, as opposed to Ember Data.)

I'm using the latest build of EM.

silvenon avatar Jul 01 '14 18:07 silvenon

I was running into this as well; turns out I wasn't setting collectionKey for a given model, so ember-model was trying to treat the entire json payload as an array (thus the .map call)

mikeauclair avatar Aug 05 '14 16:08 mikeauclair

I forgot where I was running into this issue. I'll definitely check if I was doing the same mistake, thanks :)

silvenon avatar Aug 05 '14 20:08 silvenon

I have this same issue. Pulling a collection from API and materializeData seems to fail... even if I set the collectionKey.

grapho avatar Aug 07 '14 13:08 grapho

Ok, back on track.

This happens to me on #fetch, which should return a single model, not a collection, so it shouldn't be treating it as an array.

silvenon avatar Sep 12 '14 19:09 silvenon

Possibly related to #408.

silvenon avatar Sep 13 '14 15:09 silvenon

Nope :cry:

silvenon avatar Sep 15 '14 13:09 silvenon

This StackOverflow question describes my issue.

silvenon avatar Sep 15 '14 16:09 silvenon