Finish details machine

This commit is contained in:
manzerbredes 2016-03-01 22:50:37 +01:00
parent 5ef1c9b8b1
commit e9108d4b97
4 changed files with 69 additions and 26 deletions

View file

@ -9,8 +9,9 @@ mainApp.controller('machineDetailsCtrl', [ '$scope', 'Compute', '$rootScope', '$
$scope.machine={};
$("#waitingForToggleMachine").hide();
$scope.$on('showMachineDetailsEvent', function(eventName ,machine){
$scope.$on('showMachineDetailsEvent', function(eventName ,machine, axioms){
$scope.machine=machine;
$scope.axioms=axioms;
console.log(machine);
$('#machineDetailsModal').modal({backdrop: false, keyboard: true});
});

View file

@ -6,19 +6,19 @@
mainApp.controller('homeCtrl', [ '$scope', 'Compute', '$rootScope', function ($scope, Compute, $rootScope)
{
var callMeAfterGetMachines=function(data){
var callMeAfterPullData=function(data){
$scope.machines=Compute.getData().machines;
}
Compute.pullMachines(callMeAfterGetMachines);
Compute.pullData(callMeAfterPullData);
$scope.raiseShowMachineDetailsEvent=function(id){
var callback=function(){
var data=Compute.getData();
$rootScope.$broadcast("showMachineDetailsEvent", data.machines[id]);
$rootScope.$broadcast("showMachineDetailsEvent", data.machines[id], data.axioms);
}
Compute.pullMachines(callback);