Setup:
git checkout stage-1
node server.js
- open browser to
http://127.0.0.1:8125/
Challenges:
-
Find the
comments
object that exists globally, and explore it -
Make a new instance of the collection class we've provided
-
Using the Backbone documentation find a way to add 10 new, unique models to the collection.
-
Using the underscore methods attached to each collection, work out how to find all the comments by one author
-
Get a summary of the collection using
toJSON
. Important method to take a look at.
####Extra Credit
-
Add a validation method to the model class that doesn't allow blank authors
-
Write a comparator function (see docs) on the collection to keep the comments sorted by author
-
Test out the
fetch
method on a collection, and thesave
,fetch
, anddestroy
methods on a model. See what they do by default, think about REST.