json - Ember data - Cannot read property 'typeKey' of undefined -


plan is trying to load the model, embedded , My app model.

I get the following error when I load (it just saves ok):

  can not type an asset type of indefinite duration: Ember.Object. undefined on extend.modelFor property can not be read 'typeKey' (http: // localhost: 4200 / assets / vendor.js: 71,051: 22) Ember.Object.extend.recordForId (at http: // localhost: 4200 / assets / vendor.js: 70,496: 21) deserializeRecordId (at http: // localhost: 4200 / assets / vendor.js: 71500: 27) at http: // localhost: 4200 / assets / vendor.js: 71477 : 11: //s at http Local host: 4200 / assets / vendor.js: 69,701: 20 at http: // localhost: 4200 / assets / vendor.js: 17,687: 20 Object.OrderedSet.forEach (at http: // localhost: 4200 / assets / vendor.js: 17530: 14) Object.Map.forEach (at http: // localhost: 4200 / assets / vendor.js: 17,685: 14) on Function.Model.reopenClass.eachRelationship (http: / / localhost: 4200 / assets / vendor.js: 69700: 42) General Rilti onships (http: // localhost: 4200 / assets / vendor.js: 71463: 12) vendor.js: 17062logToConsole  

With that said I have the following model,

app / model / app JS

  Export DSD. Planet: DS.Belongto ('plan', {embedded: 'load'}), producer: DS.blogsto ('user') (model: 'name' attribute ('string'), domain: attribute ('string'), , {ASCNSE: true}), time-stamp: attribute ('string' {defaultValue: function () {return moment (.) Format ("YYYY / MM / DD HH: mm: SS");}})}) ;  

app / model / plan.js

  export default DS.Model.extend ({value: attribute ('number Attribute '(' string '), title: attribute (' string '), attributes: attribute (' array ') // array is defined in a conversion, it is not worry.});  < / Pre> 

is planning like a static document.

My server response is when calling store.get ('creator.apps'); < / P>

  {"Application": [{"_id": "53da9994b2878d0000a2e 68f "," name ":" map "," domain ":" Http://myappkcom "," manufacturer ":" 53d9598bb25244e9bla72e53 "," plan ": {" _ id ":" 53d93c44b760612f9d07c921 "," price " : "", "Description": "Free plan", "tagline": "Great for testing", "title": "developer", "features": ["5,000 request", "API / plugin access"] , "__v": 0}, "time_stamp": "2014/07/31 13:31:32", "__v": 0}]}  

I realize that type There is no model for response due to error amber. I can confirm that this app finds type, usually hash.app Well done a hook fire.

Sorry, this is such a long post, just can not wrap my head due to this issue!

  app Thing = DS.Model.extend ({name: attr ('string' ), Children: DS.hasMany ('child', {inverse: faucet}}}); App ThingSerializer = DS.RESTSerializer.extend (DS.EmbeddedRecordsMixin, {attrs: {kids: {embedded: 'always'}}});  

DS.EmbeddedRecordsMixin should be in your model and you must be 'embedded:' always for the right attribute.

If you have a talk model, then you can load embedded babies of amber data using model-specific serializer (Here and the array of nested objects ).

Resource:


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -