serializeHasMany (snapshot, json, relationship)
serializeHasMany
can be used to customize how DS.hasMany
properties are serialized.
Example
app/serializers/post.js
import DS from 'ember-data'; export default DS.JSONSerializer.extend({ serializeHasMany: function(snapshot, json, relationship) { var key = relationship.key; if (key === 'comments') { return; } else { this._super.apply(this, arguments); } } });
Parameters:
-
snapshot
DS.Snapshot
-
json
Object
-
relationship
Object
Please login to continue.