Class Serializer
public
Extends:
Ember.EmberObject
Defined in:
../serializer/src/index.ts:115
Module:
@ember-data/serializer
⚠️ CAUTION you likely want the docs for
Serializer as extending this abstract class is unnecessary.
Serializer
is an abstract base class that you may override in your
application to customize it for your backend. The minimum set of methods
that you should implement is:
normalizeResponse()
serialize()
And you can optionally override the following methods:
normalize()
For an example implementation, see JSONSerializer, the included JSON serializer.
store public
Module:
@ember-data/serializer
Defined in ../packages/serializer/src/index.ts:140
The store
property is the application's store
that contains
all records. It can be used to look up serializers for other model
types that may be nested inside the payload response.
Example:
Serializer.extend({
extractRelationship(relationshipModelName, relationshipHash) {
let modelClass = this.store.modelFor(relationshipModelName);
let relationshipSerializer = this.store.serializerFor(relationshipModelName);
return relationshipSerializer.normalize(modelClass, relationshipHash);
}
});