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
|
/**
* The home controller
*
* @param {$scope} $scope The $scope service from angular
*/
mainApp.controller('machineCreationCtrl', ['$scope', 'Compute', '$rootScope', '$timeout', 'Identity', function ($scope, Compute, $rootScope, $timeout, Identity)
{
$scope.name = "loic"
// When we need to show details of machine
$scope.$on('showMachineCreationEvent', function (eventName, axioms) {
$scope.axioms=axioms;
$('#machineCreationModal').modal({backdrop: false, keyboard: true});
});
$scope.createMachine=function(){
machine={}
machine.name="loicTest"
machine.flavorId=1
machine.imageId="fd1ea580-a83e-4dc8-833c-96ce2b6f1358"
Compute.createMachine(function(){console.log("done")}, machine)
};
}]);
|