DS.Adapter#serialize()

serialize (snapshot, options) Object

Defined in addon/adapter.js:255

Proxies to the serializer's serialize method.

Example

app/adapters/application.js
import DS from 'ember-data';

export default DS.Adapter.extend({
  createRecord: function(store, type, snapshot) {
    var data = this.serialize(snapshot, { includeId: true });
    var url = `/${type.modelName}`;

    // ...
  }
});

Parameters:

snapshot DS.Snapshot
options Object

Returns:

Object
serialized snapshot
doc_EmberJs
2016-11-30 16:49:25
Comments
Leave a Comment

Please login to continue.