attributes{Ember.Map}
static
A map whose keys are the attributes of the model (properties described by DS.attr) and whose values are the meta object for the property.
Example
app/models/person.js
import DS from 'ember-data'; export default DS.Model.extend({ firstName: attr('string'), lastName: attr('string'), birthday: attr('date') });
import Ember from 'ember'; import Person from 'app/models/person'; var attributes = Ember.get(Person, 'attributes') attributes.forEach(function(meta, name) { console.log(name, meta); }); // prints: // firstName {type: "string", isAttribute: true, options: Object, parentType: function, name: "firstName"} // lastName {type: "string", isAttribute: true, options: Object, parentType: function, name: "lastName"} // birthday {type: "date", isAttribute: true, options: Object, parentType: function, name: "birthday"}
Please login to continue.