From e67422ad7ed2645aa0f1f18ff54e762a12929dc5 Mon Sep 17 00:00:00 2001 From: Jeremy Ashkenas Date: Fri, 1 Jul 2011 10:38:14 -0400 Subject: [PATCH] restoring some examples. --- index.html | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/index.html b/index.html index 6112acffd..d80bf1130 100644 --- a/index.html +++ b/index.html @@ -780,9 +780,7 @@

Backbone.Model

book.save(); -book.save({ - author: "Teddy" -}); +book.save({author: "Teddy"});

@@ -1152,25 +1150,15 @@

Backbone.Collection

-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"}
 ]);