Semaphore/public/js/controllers/projects/templates.js
Matej Kramny 2e1ad91e7a Running tasks
- Link models with tables
- Basic API to fetch everything
2016-04-07 13:49:34 +01:00

19 lines
590 B
JavaScript

define(function () {
app.registerController('ProjectTemplatesCtrl', ['$scope', '$http', '$uibModal', 'Project', function ($scope, $http, $modal, Project) {
$scope.reload = function () {
$http.get(Project.getURL() + '/templates').success(function (templates) {
$scope.templates = templates;
});
}
$scope.remove = function (environment) {
$http.delete(Project.getURL() + '/templates/' + environment.id).success(function () {
$scope.reload();
}).error(function () {
swal('error', 'could not delete template..', 'error');
});
}
$scope.reload();
}]);
});