From 97a07163f24e648232aeb13b204534286d68ee00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Ple=C3=9F?= Date: Wed, 23 Jul 2014 03:33:36 +0200 Subject: [PATCH] fixing an error with the gage loading at page reload --- node/public/js/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node/public/js/app.js b/node/public/js/app.js index 943546e..bad3237 100644 --- a/node/public/js/app.js +++ b/node/public/js/app.js @@ -10,8 +10,8 @@ angular.module('roomstateapp.controllers', []). url: '/api/simple/v2' }). success(function (data, status, headers, config) { - gpower.refresh(message.data.power); $scope.simple = data; + gpower.refresh(data.power); }). error(function (data, status, headers, config) { //$scope.name = 'Error!' @@ -20,8 +20,8 @@ angular.module('roomstateapp.controllers', []). Socket.on('sdata', function(message) { console.log("received data from server: " + message.data.names); - gpower.refresh(message.data.power); $scope.simple = message.data; + gpower.refresh(message.data.power); }); });