mqtt_server/app/js/modules/temp.js

24 lines
472 B
JavaScript
Raw Normal View History

2016-11-23 19:19:03 +00:00
/**
* Created by martin on 11/23/16.
*/
let TempModel = Backbone.Model.extend({});
let Temp = Backbone.View.extend({
tagName: 'div',
initialize: function () {
_.bindAll(this, 'render');
this.model.bind('change', this.render);
this.$indoorTemp = $('#indoorTemp');
},
render: function () {
console.log('Temp:Render');
const data = this.model.get('data');
this.$indoorTemp.empty().html(parseFloat(data.temp) + '°c ');
}
});