Documentation / @ember-data/legacy-compat / index / serializerFor
ts
function serializerFor(this, modelName):
| null
| MinimumSerializerInterface;
Defined in: index.ts:113
Returns an instance of the serializer for a given type. For example, serializerFor('person')
will return an instance of App.PersonSerializer
.
If no App.PersonSerializer
is found, this method will look for an App.ApplicationSerializer
(the default serializer for your entire application).
If a serializer cannot be found on the adapter, it will fall back to an instance of JSONSerializer
.
Parameters
this
modelName
string
the record to serialize
Returns
| null
| MinimumSerializerInterface