model.clear

clearmodel.clear([options]) Removes all attributes from the model, including the id attribute. Fires a "change" event unless silent is passed as an option.

collection.toArray

toArray

collection.parse

parsecollection.parse(response, options) parse is called by Backbone whenever a collection's models are returned by the server, in fetch. The function is passed the raw response object, and should return the array of model attributes to be added to the collection. The default implementation is a no-op, simply passing through the JSON response. Override this if you need to work with a preexisting API, or better namespace your responses. var Tweets = Backbone.Collection.extend({ // The Twitt

View

constructor / initializenew View([options]) There are several special options that, if passed, will be attached directly to the view: model, collection, el, id, className, tagName, attributes and events. If the view defines an initialize function, it will be called when the view is first created. If you'd like to create a view that references an element already in the DOM, pass in the element as an option: new View({el: existingElement}) var doc = documents.first(); new DocumentRow({ mod

route event

"route" (route, params) â Fired by the router when any route has been matched.

model.omit

omit

model.set

setmodel.set(attributes, [options]) Set a hash of attributes (one or many) on the model. If any of the attributes change the model's state, a "change" event will be triggered on the model. Change events for specific attributes are also triggered, and you can bind to those as well, for example: change:title, and change:content. You may also pass individual keys and values. note.set({title: "March 20", content: "In his eyes she eclipses..."}); book.set("title", "A Scandal in Bohemia");

collection.countBy

countBy

model.pairs

pairs

Router

constructor / initializenew Router([options]) When creating a new router, you may pass its routes hash directly as an option, if you choose. All options will also be passed to your initialize function, if defined.