keyForAttribute (key, method) String
keyForAttribute can be used to define rules for how to convert an attribute name in your model to a key in your JSON.
Example
app/serializers/application.jsimport DS from 'ember-data';
export default DS.RESTSerializer.extend({
keyForAttribute: function(attr, method) {
return Ember.String.underscore(attr).toUpperCase();
}
});
Parameters:
-
key
String -
method
String
Returns:
-
String - normalized key
Please login to continue.