You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

33 lines
1000 B

angular.module('app.password', ['pascalprecht.translate'])
.controller('PasswordCtrl', function($scope, $stateParams, $translate,
$http, $ionicLoading) {
$scope.newPass = {};
$scope.changePassword = function() {
console.log($scope.newPass);
$http({
url: urlapi + 'changePassword',
method: "PUT",
data: $scope.newPass
})
.then(function(data) {
console.log(data);
$ionicLoading.show({
template: 'Password updated',
noBackdrop: true,
duration: 2000
});
window.location = "#app/settings";
},
function(data) { // optional
// failed
console.log(data);
$ionicLoading.show({
template: 'Error updating password',
noBackdrop: true,
duration: 2000
});
});
};
});