Semaphore/public/js/controllers/projects/inventory.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
591 B
JavaScript

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