[Pkg-javascript-commits] [backbone] 206/211: restoring some examples.
Jonas Smedegaard
js at moszumanska.debian.org
Sat May 3 17:00:26 UTC 2014
This is an automated email from the git hooks/post-receive script.
js pushed a commit to tag 0.5.0
in repository backbone.
commit e67422ad7ed2645aa0f1f18ff54e762a12929dc5
Author: Jeremy Ashkenas <jashkenas at gmail.com>
Date: Fri Jul 1 10:38:14 2011 -0400
restoring some examples.
---
index.html | 22 +++++-----------------
1 file changed, 5 insertions(+), 17 deletions(-)
diff --git a/index.html b/index.html
index 6112acf..d80bf11 100644
--- a/index.html
+++ b/index.html
@@ -780,9 +780,7 @@ var book = new Backbone.Model({
book.save();
-book.save({
- author: "Teddy"
-});
+book.save({author: "Teddy"});
</pre>
<p>
@@ -1152,25 +1150,15 @@ var alphabetical = Books.sortBy(function(book) {
</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>
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/backbone.git
More information about the Pkg-javascript-commits
mailing list