Browse files

Merge pull request #214 from booltype/gh-pages

Typo in Model.get() sample code
  • Loading branch information...
2 parents f3c30ab + 15d8254 commit 62474336e097a5ed19df18f12fc64b7096ecd351 @addyosmani committed Nov 10, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1
@@ -635,7 +635,7 @@ var todo2 = new Todo({
completed: true
console.log(todo2.get('title')); // Retrieved with models get() method.
-console.log(todo2.get('completed')); // false
+console.log(todo2.get('completed')); // true
If you need to read or clone all of a model's data attributes use its `toJSON` method. Despite the name it doesn't return a JSON string but a copy of the attributes as an object. ("toJSON" is part of the JSON.stringify specification. Passing an object with a toJSON method makes it stringify the return value of that method instead of the object itself.)

0 comments on commit 6247433

Please sign in to comment.