DS.EmbeddedRecordsMixin#normalize()

normalize (typeClass, hash, prop) Object

Defined in addon/serializers/embedded-records-mixin.js:100

Normalize the record and recursively normalize/extract all the embedded records while pushing them into the store as they are encountered

A payload with an attr configured for embedded records needs to be extracted:

{
  "post": {
    "id": "1"
    "title": "Rails is omakase",
    "comments": [{
      "id": "1",
      "body": "Rails is unagi"
    }, {
      "id": "2",
      "body": "Omakase O_o"
    }]
  }
}

Parameters:

typeClass DS.Model
hash Object
to be normalized
prop String
the hash has been referenced by

Returns:

Object
the normalized hash
doc_EmberJs
2016-11-30 16:49:33
Comments
Leave a Comment

Please login to continue.