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

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -