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
1012 B

angular.module('app.password', ['pascalprecht.translate'])
.controller('PasswordCtrl', function($scope, $stateParams, $translate,
$http, $ionicLoading) {
$scope.newPassword = {};
$scope.changePassword = function() {
console.log($scope.newPassword);
$http({
url: urlapi + 'changePassword',
method: "PUT",
data: $scope.newPassword
})
.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
});
});
};
});