Semaphore/public/js/controllers/projects/taskRunner.js
2016-04-17 01:20:23 +01:00

18 lines
552 B
JavaScript

define(function () {
app.registerController('CreateTaskCtrl', ['$scope', '$http', 'Template', 'Project', function ($scope, $http, Template, Project) {
console.log(Template);
$scope.task = {};
$scope.run = function (task) {
task.template_id = Template.id;
$http.post(Project.getURL() + '/tasks', task).success(function (t) {
}).error(function (_, status) {
swal('Error', 'error launching task: HTTP ' + status, 'error');
});
}
}]);
app.registerController('TaskCtrl', ['$scope', '$http', function ($scope, $http) {
}]);
});