Skip to content

Commit

Permalink
Merge pull request jashkenas#2423 from braddunbar/model-changed
Browse files Browse the repository at this point in the history
Fix jashkenas#2422 - Clarify docs about changed attributes.
  • Loading branch information
tgriesser committed Mar 25, 2013
2 parents dd49c6a + 795b442 commit 820182b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1128,7 +1128,7 @@ <h2 id="Model">Backbone.Model</h2>
<b class="header">changed</b><code>model.changed</code>
<br />
The <b>changed</b> property is the internal hash containing all the attributes
that have changed since the last <tt>"change"</tt> event was triggered.
that have changed since the last <a href="Model#set">set</a>.
Please do not update <b>changed</b> directly since its state is internally maintained
by <a href="#Model-set">set</a>. A copy of <b>changed</b> can be acquired from
<a href="#Model-changedAttributes">changedAttributes</a>.
Expand Down Expand Up @@ -1485,7 +1485,7 @@ <h2 id="Model">Backbone.Model</h2>
<p id="Model-hasChanged">
<b class="header">hasChanged</b><code>model.hasChanged([attribute])</code>
<br />
Has the model changed since the last <tt>"change"</tt> event? If an <b>attribute</b>
Has the model changed since the last <a href="#Model-set">set</a>? If an <b>attribute</b>
is passed, returns <tt>true</tt> if that specific attribute has changed.
</p>

Expand All @@ -1505,8 +1505,8 @@ <h2 id="Model">Backbone.Model</h2>
<p id="Model-changedAttributes">
<b class="header">changedAttributes</b><code>model.changedAttributes([attributes])</code>
<br />
Retrieve a hash of only the model's attributes that have changed, or
<tt>false</tt> if there are none. Optionally, an external
Retrieve a hash of only the model's attributes that have changed since the last
<a href="#Model-set">set</a>, or <tt>false</tt> if there are none. Optionally, an external
<b>attributes</b> hash can be passed in, returning the attributes in that
hash which differ from the model. This can be used to figure out which
portions of a view should be updated, or what calls
Expand Down Expand Up @@ -2026,10 +2026,10 @@ <h2 id="Collection">Backbone.Collection</h2>
<b class="header">fetch</b><code>collection.fetch([options])</code>
<br />
Fetch the default set of models for this collection from the server,
<a href="#Collection-set">setting</a> them on the collection when they arrive.
The <b>options</b> hash takes <tt>success</tt> and <tt>error</tt> callbacks
<a href="#Collection-set">setting</a> them on the collection when they arrive.
The <b>options</b> hash takes <tt>success</tt> and <tt>error</tt> callbacks
which will both be passed <tt>(collection, response, options)</tt> as arguments.
When the model data returns from the server, it uses <a href="#Collection-set">set</a>
When the model data returns from the server, it uses <a href="#Collection-set">set</a>
to (intelligently) merge the fetched models, unless you pass <tt>{reset: true}</tt>,
in which case the collection will be (efficiently) <a href="#Collection-reset">reset</a>.
Delegates to <a href="#Sync">Backbone.sync</a>
Expand Down

0 comments on commit 820182b

Please sign in to comment.