summaryrefslogtreecommitdiff
path: root/client/js/controllers/home/main.js
blob: 805bc630f9b98c53e16c70ee46e2a38829fa19d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/**
 * The home controller
 * 
 * @param {$scope} $scope The $scope service from angular
 */
mainApp.controller('homeCtrl', [ '$scope', 'Compute', '$rootScope', function ($scope, Compute, $rootScope)
{

	var updatePage=function(){
		// TODO Update graph etc...
	}




	
	$scope.raiseShowMachineDetailsEvent=function(){
		var callback=function(){
			var data=Compute.getData();
			console.log(data.machines[Object.keys(data.machines)[0]]);
			$rootScope.$broadcast("showMachineDetailsEvent", data.machines[Object.keys(data.machines)[0]]);		
	
		}
		Compute.pullMachines(callback);
	}


}]);