Semaphore/public/js/controllers/user/add.js
Matej Kramny 0f180756ab Auth page
- Restructuring & co
2016-03-18 22:03:28 +00:00

14 lines
356 B
JavaScript

define(function () {
app.registerController('AddUserCtrl', ['$scope', '$state', '$http', function($scope, $state, $http) {
$scope.user = {};
$scope.add = function () {
$http.post('/users', $scope.user)
.success(function (data) {
$state.transitionTo('users.list');
}).error(function () {
alert('cannot add user.')
});
}
}]);
});