mirror of
https://github.com/jashkenas/backbone.git
synced 2026-02-15 01:05:12 -05:00
Allowing Model#defaults to be a function as well as a hash.
This commit is contained in:
@@ -642,11 +642,11 @@ if (note.has("title")) {
|
||||
</p>
|
||||
|
||||
<p id="Model-defaults">
|
||||
<b class="header">defaults</b><code>model.defaults</code>
|
||||
<b class="header">defaults</b><code>model.defaults or model.defaults()</code>
|
||||
<br />
|
||||
The <b>defaults</b> hash can be used to specify the default attributes
|
||||
for your model. When creating an instance of the model, any unspecified
|
||||
attributes will be set to their default value.
|
||||
The <b>defaults</b> hash (or function) can be used to specify the default
|
||||
attributes for your model. When creating an instance of the model,
|
||||
any unspecified attributes will be set to their default value.
|
||||
</p>
|
||||
|
||||
<pre class="runnable">
|
||||
|
||||
Reference in New Issue
Block a user