bunti-node/js/modules/devices/switch.js

26 lines
603 B
JavaScript
Executable File

// js/modules/controls.js
// Module reference argument, assigned at the bottom
(function (Switch) {
Switch.Model = Backbone.Model.extend({
defaults: {
status: 'off'
}
});
Switch.List = Backbone.Collection.extend({
model: Switch.Model
});
Switch.View = Backbone.View.extend({
render: function () {
this.template = Handlebars.compile(Util.getTemplate('switch'));
this.$el.html(this.template(this.model.toJSON()));
return this;
}
});
})(app.module("switch"));