DS.JSONSerializer#extractMeta()

extractMeta (store, modelClass, payload)

Defined in addon/serializers/json.js:1288

extractMeta is used to deserialize any meta information in the adapter payload. By default Ember Data expects meta information to be located on the meta property of the payload object.

Example

app/serializers/post.js
import DS from 'ember-data';

export default DS.JSONSerializer.extend({
  extractMeta: function(store, typeClass, payload) {
    if (payload && payload.hasOwnProperty('_pagination')) {
      let meta = payload._pagination;
      delete payload._pagination;
      return meta;
    }
  }
});

Parameters:

store DS.Store
modelClass DS.Model
payload Object
doc_EmberJs
2016-11-30 16:49:49
Comments
Leave a Comment

Please login to continue.