Skip to content

Instantly share code, notes, and snippets.

@CheezItMan
Forked from anonymous/app.js
Last active May 19, 2017 21:04
Show Gist options
  • Save CheezItMan/38fac3dfd1f26cdd19a32b50b2a5c359 to your computer and use it in GitHub Desktop.
Save CheezItMan/38fac3dfd1f26cdd19a32b50b2a5c359 to your computer and use it in GitHub Desktop.
app.js
import Backbone from 'backbone';
var Task = Backbone.Model.extend({
defaults: {
title: '',
completed: false
},
logStatus: function() {
console.log("Title: " + this.get("title"));
console.log("Completed: " + this.get("completed"));
},
toggleComplete: function() {
this.set("completed", !this.get("completed"));
},
initialize: function(params) {
console.log("Task initialized: " + this.get("title"));
// just to see what params looks like
console.log(params);
}
});
export default Task;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment