modelNameString
static
Represents the model's class name as a string. This can be used to look up the model through DS.Store's modelFor method.
modelName
is generated for you by Ember Data. It will be a lowercased, dasherized string. For example:
store.modelFor('post').modelName; // 'post' store.modelFor('blog-post').modelName; // 'blog-post'
The most common place you'll want to access modelName
is in your serializer's payloadKeyFromModelName
method. For example, to change payload keys to underscore (instead of dasherized), you might use the following code:
export default var PostSerializer = DS.RESTSerializer.extend({ payloadKeyFromModelName: function(modelName) { return Ember.String.underscore(modelName); } });
Please login to continue.