@Chris_Johnson wrote:
I’m having some trouble accessing some nested data in one of my Ember models. Below is the JSON response…
{ "fields": { "header": { "name": "header", "type": "text", "localize": false, "options": [] }, "body": { "name": "body", "type": "textarea", "localize": false, "options": [] } }, "entries": [ { "header": "header test", "body": "body test body test body test", "_mby": "5a395e8430c2ddoc683600766", "_by": "5a395e8430c2ddoc683600766", "_modified": 1513709605, "_created": 1513709605, "_id": "5a3960253d578doc735798511" } ], "total": 1 }
Here is my current serializer
import DS from 'ember-data'; export default DS.RESTSerializer.extend({ normalizeResponse(store, primaryModelClass, payload, id, requestType) { payload = { entries: payload.entries }; return this._super(store, primaryModelClass, payload, id, requestType); } });
I’m trying to get the Entries in my template. Perhaps I need some help better serializing this with NormalizeResponse? I’m very stumped so please share if you have any ideas!
Thanks!!
Posts: 2
Participants: 2