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); }); });