DS.Model.transformedAttributes

transformedAttributes{Ember.Map}static

Defined in addon/-private/system/model/attr.js:71

A map whose keys are the attributes of the model (properties described by DS.attr) and whose values are type of transformation applied to each attribute. This map does not include any attributes that do not have an transformation type.

Example

app/models/person.js
import DS from 'ember-data';

export default DS.Model.extend({
  firstName: attr(),
  lastName: attr('string'),
  birthday: attr('date')
});
import Ember from 'ember';
import Person from 'app/models/person';

var transformedAttributes = Ember.get(Person, 'transformedAttributes')

transformedAttributes.forEach(function(field, type) {
  console.log(field, type);
});

// prints:
// lastName string
// birthday date
doc_EmberJs
2016-11-30 16:50:18
Comments
Leave a Comment

Please login to continue.