mirror of
https://github.com/semaphoreui/semaphore.git
synced 2025-01-22 08:10:50 +01:00
79a05b389f
- [wip] ws support
21 lines
611 B
JavaScript
21 lines
611 B
JavaScript
define(['controllers/projects/edit'], function () {
|
|
app.registerController('DashboardCtrl', ['$scope', '$http', '$uibModal', function ($scope, $http, $modal) {
|
|
$scope.projects = [];
|
|
|
|
$http.get('/projects').success(function (projects) {
|
|
$scope.projects = projects;
|
|
})
|
|
|
|
$scope.addProject = function () {
|
|
$modal.open({
|
|
templateUrl: '/tpl/projects/add.html'
|
|
}).result.then(function (project) {
|
|
$http.post('/projects', project)
|
|
.success(function () {
|
|
}).error(function (data, status) {
|
|
swal('Error', 'Could not create project: ' + status, 'error');
|
|
});
|
|
});
|
|
}
|
|
}]);
|
|
}); |