ember.js - Can I define a default value for ember-data model attributes? -
when define attribute model in ember-data, can specify default value?
the ember-data model definition suggests attributes defined this:
attributename: ds.attr('number') ...with optional second argument options hash. i've looked @ the code code-reading skills aren't figuring out attributes can put in options hash. possible this?
attributename: ds.attr('number', { default: 0 }) or
attributename: ds.attr('boolean', { default: false }) ?
you close, it's defaultvalue, see attributes.js#l63-65.
Comments
Post a Comment