I\'m using Ember data and having a hard time figuring out get ember to recognize nested properties in my JSON response from the server. This is ember-1.0.0-pre.4.js.
<Looks like sma's answer was correct, I just needed a reference to the adapter first. This bit...
DS.RESTAdapter.map 'App.School', addr {embedded: 'always' }
...gives an error 'cannot call map of undefined'. So updated to...
App.Adapter = DS.RESTAdapter.extend
bulkCommit: false
App.Adapter.map 'App.School', {
addr: {embedded: 'always'}
}
Works now!
Since you're embedding the addr JSON in your schools JSON you need to setup the mapping in the DS.RESTAdapter.
DS.RESTAdapter.map 'App.School',
addr: { embedded: 'always' }
The embedded option can have two values, 1) always, 2) load.
See Yehuda's answer here for the details: https://stackoverflow.com/a/14324532/1409279
Did you get time to look at
Ember Data: Model Fragments
It allows nested data