ohmyform/public/modules/users/controllers/change_password.client.controller.js
2017-10-28 01:19:09 -07:00

30 lines
794 B
JavaScript

'use strict';
angular.module('users').controller('ChangePasswordController', ['$scope', '$rootScope', '$http', '$state', 'Users', 'Auth',
function($scope, $rootScope, $http, $state, Users, Auth) {
$scope.user = Auth.currentUser;
console.log($scope.user)
$scope.cancel = function(){
$scope.user = Auth.currentUser;
}
// Change user password
$scope.changeUserPassword = function() {
$scope.success = $scope.error = null;
$http.post('/users/password', $scope.passwordDetails).success(function(response) {
// If successful show success message and clear form
$scope.success = true;
$scope.error = null;
$scope.passwordDetails = null;
}).error(function(response) {
$scope.success = null;
$scope.error = response.message;
});
};
*/
}
]);