Skip to content

Commit

Permalink
restoring some examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
jashkenas committed Jul 1, 2011
1 parent 1491d29 commit e67422a
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions index.html
Expand Up @@ -780,9 +780,7 @@ <h2 id="Model">Backbone.Model</h2>

book.save();

book.save({
author: "Teddy"
});
book.save({author: "Teddy"});
</pre>

<p>
Expand Down Expand Up @@ -1152,25 +1150,15 @@ <h2 id="Collection">Backbone.Collection</h2>
</p>

<pre class="runnable">
var Ship = Backbone.Model.extend({
defaults: {
"name": "Black Pearl"
}
});

var Fleet = Backbone.Collection.extend({
model: Ship
});

var pirates = new Fleet();
var ships = new Backbone.Collection;

pirates.bind("add", function(ship) {
ships.bind("add", function(ship) {
alert("Ahoy " + ship.get("name") + "!");
});

pirates.add([
ships.add([
{name: "Flying Dutchman"},
{captain: "Jack Sparrow"}
{name: "Black Pearl"}
]);
</pre>

Expand Down

0 comments on commit e67422a

Please sign in to comment.