sum7/warehost-frontend
sum7
/
warehost-frontend
Archived
1
0
Fork 0
This repository has been archived on 2020-09-27. You can view files and clone it, but cannot push or open issues or pull requests.
warehost-frontend/public/app/setting.js

29 lines
739 B
JavaScript

'use strict';
angular.module('warehost')
.controller('SettingCtrl',function(session,config,alert,$scope,$http){
$scope.obj = {};
alert.set({});
$scope.submit = function(){
if($scope.obj.newPassword === $scope.obj.repeatPassword){
$http.post(config.api+'/password',$scope.obj).then(function(res){
session.set(res);
alert.set(res);
$scope.obj = {};
});
}else{
alert.set({msg:'Not equal Passwords'});
}
};
$scope.delete = function(){
if(window.confirm('realy delete your login and everything else on warehost?')){
$http.get(config.api+'/delete').then(function(res){
session.set(res);
alert.set(res);
});
}else{
alert.set({msg:'Account not deleted'});
}
};
});