Files
meanTorrent/modules/users/client/controllers/settings/change-password.client.controller.js
Ryan Hutchison ef3a3f9548 formatting reboot (space-2 and consistency)
JSCS fixes

update editorconfig
2015-07-31 10:04:02 -04:00

21 lines
648 B
JavaScript

'use strict';
angular.module('users').controller('ChangePasswordController', ['$scope', '$http', 'Authentication',
function ($scope, $http, Authentication) {
$scope.user = Authentication.user;
// Change user password
$scope.changeUserPassword = function () {
$scope.success = $scope.error = null;
$http.post('/api/users/password', $scope.passwordDetails).success(function (response) {
// If successful show success message and clear form
$scope.success = true;
$scope.passwordDetails = null;
}).error(function (response) {
$scope.error = response.message;
});
};
}
]);