1
0
mirror of https://github.com/BoostIo/Boostnote synced 2026-01-03 20:19:17 +00:00

add settings/password_change state

This commit is contained in:
Rokt33r
2015-06-15 18:43:51 +09:00
parent a3ae5f02dd
commit 4094fff859
8 changed files with 102 additions and 2 deletions

View File

@@ -0,0 +1,33 @@
/* global angular */
angular.module('codexen')
.controller('SettingsController', function (Settings) {
var vm = this
vm.changePassword = changePassword
vm.isSuccess = false
vm.isError = false
function changePassword () {
var params = {
password: vm.password,
newPassword: vm.newPassword
}
Settings.changePassword(params)
.success(function (data) {
resetInput()
vm.isSuccess = true
vm.isError = false
})
.error(function () {
resetInput()
vm.isError = true
vm.isSuccess = false
})
}
function resetInput () {
vm.password = ''
vm.newPassword = ''
}
})