Skip to content

Instantly share code, notes, and snippets.

@rightson
Created June 24, 2012 23: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 rightson/2985478 to your computer and use it in GitHub Desktop.
Save rightson/2985478 to your computer and use it in GitHub Desktop.
Person = Backbone.Model.extend({
initialize: function() {
console.log('hello world!');
this.bind("change:name", function() {
console.log(persion.get('name'));
});
this.bind("error", function(model, error) {
console.log('error');
});
},
validate: function( attributes ) {
if (attributes.name == 'kenny' ) {
return 'Kenny is the founder of babylife';
}
},
//...
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment