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
Raw Normal View History

2016-08-14 13:37:26 +02:00
'use strict';
angular.module('warehost')
2016-09-11 18:40:03 +02:00
.controller('SettingCtrl',function(session,config,alert,$scope,$http){
2016-08-14 13:37:26 +02:00
$scope.obj = {};
2016-08-17 22:35:25 +02:00
alert.set({});
2016-08-14 13:37:26 +02:00
$scope.submit = function(){
2016-08-17 22:35:25 +02:00
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'});
}
2016-08-14 13:37:26 +02:00
};
$scope.delete = function(){
2016-08-14 14:22:11 +02:00
if(window.confirm('realy delete your login and everything else on warehost?')){
2016-08-14 13:37:26 +02:00
$http.get(config.api+'/delete').then(function(res){
session.set(res);
2016-08-17 22:35:25 +02:00
alert.set(res);
2016-08-14 13:37:26 +02:00
});
2016-08-17 22:35:25 +02:00
}else{
alert.set({msg:'Account not deleted'});
2016-08-14 13:37:26 +02:00
}
2016-08-14 14:22:11 +02:00
};
2016-08-14 13:37:26 +02:00
});