backbone-skull
Version:
Skull sits on top of Backbone and protects your application's brains.
27 lines (22 loc) • 586 B
JavaScript
define(
[
'./Abstract'
],
function (ModelAbstract) {
'use strict';
var ModelTodo = ModelAbstract.extend({
defaults: {
title: '',
completed: false
},
resource: 'todos',
initialize: function (attributes, options) {
ModelTodo.__super__.initialize.apply(this, arguments);
},
toggleCompleted: function () {
this.set('completed', !this.get('completed'));
}
});
return ModelTodo;
}
);