24 lines
472 B
JavaScript
24 lines
472 B
JavaScript
/**
|
|
* 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 ');
|
|
}
|
|
|
|
});
|