Skip to content

Instantly share code, notes, and snippets.

@codylindley
Last active December 19, 2015 12:49
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codylindley/5957808 to your computer and use it in GitHub Desktop.
Save codylindley/5957808 to your computer and use it in GitHub Desktop.
var myModel = new Backbone.Model(attributes, {options}, anything-else-passed-to-initialize-function);
/*
attributes = {data:value, data:value} or [value,value]
options = {
collection: {},
url: '',
urlRoot: '',
parse: boolean
}
*/
var myCollection = new Backbone.Collection([models], {options}, anything-else-passed-to-initialize-function);
/*
models = [model,model,model]
options = {
url: '',
model: {},
comparator: function(){} || ''
}
*/
var myView = new Backbone.View({options}, anything-else-passed-to-initialize-function);
/*
options = {
model: {},
collection: {},
el: '',
id: '',
className: '',
tagName: '',
attributes: {attribute:value,attribute:value}
}
*/
var myRouter = new Backbone.Router({options}, anything-else-passed-to-initialize-function);
/*
options = {
routes:{}
}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment