Skip to content

Instantly share code, notes, and snippets.

@h2ospace
Created March 15, 2013 04:05
Show Gist options
  • Save h2ospace/5167413 to your computer and use it in GitHub Desktop.
Save h2ospace/5167413 to your computer and use it in GitHub Desktop.
Backbone: model basic
(function() {
// Model
var Task = Backbone.Model.extend({
defaults: {
title: 'do something!',
completed: false
}
});
var task1 = new Task({
completed: true
});
console.log(task1.toJSON());
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment