Add user management

This commit is contained in:
2016-09-23 15:12:46 -04:00
parent 9f50a4635c
commit 0b5dde065a
53 changed files with 1046 additions and 690 deletions
@@ -0,0 +1,37 @@
(function() {
"use strict";
window.app.directive('userCreate', function() {
return {
templateUrl: '/user/template/userCreate.tmpl.cshtml',
controller: controller,
controllerAs: 'vm'
}
});
function controller($scope, userSvc){
var vm = this;
vm.saving = false;
vm.user = {};
vm.statusMessage = "Create a user";
vm.errorMessages = [];
vm.create = function() {
vm.statusMessage = null;
vm.saving = true;
userSvc.create(vm.user)
.success(function() {
//Close the modal
$scope.$close();
})
.error(function(data) {
vm.errorMessages = angular.copy(data.errorMessages, vm.errorMessages);
})
.finally(function() {
vm.saving = false;
});
};
}
})();