blob: 2e9c00b8d1e99d9162f65a0d048757d317ab895e (
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
29
30
31
32
|
/**
* The home controller
*
* @param {$scope} $scope The $scope service from angular
*/
mainApp.controller('homeCtrl', [ '$scope', 'Compute', '$rootScope', 'Loading', function ($scope, Compute, $rootScope, Loading)
{
var callMeAfterPullData=function(data){
$scope.machines=Compute.getData().machines;
Loading.stop();
}
Loading.start();
Compute.pullData(callMeAfterPullData);
$scope.raiseShowMachineDetailsEvent=function(id){
var callback=function(){
Loading.stop();
var data=Compute.getData();
$rootScope.$broadcast("showMachineDetailsEvent", data.machines[id], data.axioms);
}
Loading.start();
Compute.pullMachines(callback);
}
}]);
|