mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-25 03:35:21 +01:00
42 lines
959 B
JavaScript
42 lines
959 B
JavaScript
(function() {
|
|
|
|
'use strict';
|
|
|
|
angular
|
|
.module('harbor.layout.sign.up')
|
|
.controller('SignUpController', SignUpController);
|
|
|
|
SignUpController.$inject = ['SignUpService', '$window'];
|
|
|
|
function SignUpController(SignUpService, $window) {
|
|
var vm = this;
|
|
|
|
vm.user = {};
|
|
vm.signUp = signUp;
|
|
|
|
function signUp(user) {
|
|
var userObject = {
|
|
'username': user.username,
|
|
'email': user.email,
|
|
'password': user.password,
|
|
'realname': user.fullName,
|
|
'comment': user.comments
|
|
};
|
|
SignUpService(userObject)
|
|
.success(signUpSuccess)
|
|
.error(signUpFailed);
|
|
}
|
|
|
|
function signUpSuccess(data, status) {
|
|
console.log('Signed up successfully:' + status);
|
|
alert('Signed up successfully');
|
|
$window.location.href = '/ng';
|
|
}
|
|
|
|
function signUpFailed(data, status) {
|
|
console.log('Signed up failed.');
|
|
}
|
|
|
|
}
|
|
|
|
})(); |