how do I represent this as a ember data model? -


i'm using ember-data 1.0.0-beta.7+canary.b45e23ba

the restful service returning json payload of:

{   "postaladdresses": [     {       "street": "12345 test drive",       "city": "testville",       "subnational": "wa",       "postalcode": "98027",       "country": "united states",       "id": 1     },     {       "street": "12345 work drive",       "city": "testville",       "subnational": "wa",       "postalcode": "98027",       "country": "united states",       "id": 2     }    ], } 

how should ds.model looks?

var postaladdresses = ds.model.extend({     street:  ds.attr('string', {defaultvalue: ''}),     city:  ds.attr('string', {defaultvalue: ''}),     subnational: ds.attr('string', {defaultvalue: ''}),     postalcode:  ds.attr('string', {defaultvalue: ''}),     country:  ds.attr('string', {defaultvalue: ''}), 

i've yet find documentation specific situation. on target? intended design? note: cannot change payload being sent me.

thanks you,

jeff


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -