fixing an error with the gage loading at page reload

This commit is contained in:
Lucas Pleß 2014-07-23 03:33:36 +02:00
parent 52aa2837df
commit 97a07163f2
1 changed files with 2 additions and 2 deletions

View File

@ -10,8 +10,8 @@ angular.module('roomstateapp.controllers', []).
url: '/api/simple/v2' url: '/api/simple/v2'
}). }).
success(function (data, status, headers, config) { success(function (data, status, headers, config) {
gpower.refresh(message.data.power);
$scope.simple = data; $scope.simple = data;
gpower.refresh(data.power);
}). }).
error(function (data, status, headers, config) { error(function (data, status, headers, config) {
//$scope.name = 'Error!' //$scope.name = 'Error!'
@ -20,8 +20,8 @@ angular.module('roomstateapp.controllers', []).
Socket.on('sdata', function(message) { Socket.on('sdata', function(message) {
console.log("received data from server: " + message.data.names); console.log("received data from server: " + message.data.names);
gpower.refresh(message.data.power);
$scope.simple = message.data; $scope.simple = message.data;
gpower.refresh(message.data.power);
}); });
}); });