Semaphore/public/js/controllers/projects/users.js
Matej Kramny 79a05b389f Project ui, ws
- [wip] ws support
2016-04-02 13:40:07 +01:00

19 lines
527 B
JavaScript

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