raumstatus/node/public/js/controllers.js

25 lines
654 B
JavaScript
Raw Normal View History

2013-10-20 22:04:58 +00:00
'use strict';
angular.module('roomstateapp.controllers', []).
controller('StatusCtrl', function ($scope, $http, Socket) {
$http({
method: 'GET',
url: '/api/simple/v2'
}).
success(function (data, status, headers, config) {
$scope.simple = data;
}).
error(function (data, status, headers, config) {
//$scope.name = 'Error!'
console.log("error getting data");
});
Socket.on('sdata', function(message) {
console.log("received data from server: " + message.data.names);
$scope.simple = message.data;
});
});