Skip to content

Instantly share code, notes, and snippets.

@ericallam
Created March 2, 2012 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericallam/1959464 to your computer and use it in GitHub Desktop.
Save ericallam/1959464 to your computer and use it in GitHub Desktop.
backbone model defaults with a function
var Appointment = Backbone.Model.extend({
defaults: function(){
date: new Date()
}
});
var app1 = new Appointment();
var app2 = new Appointment();
app1.get('date') !== app2.get('date')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment