Created
March 15, 2013 04:05
-
-
Save h2ospace/5167413 to your computer and use it in GitHub Desktop.
Backbone: model basic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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