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

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

25 lines
712 B
JavaScript

'use strict';
angular.module('users').controller('EditProfileController', ['$scope', '$http', '$location', 'Users', 'Authentication',
function ($scope, $http, $location, Users, Authentication) {
$scope.user = Authentication.user;
// Update a user profile
$scope.updateUserProfile = function (isValid) {
if (isValid) {
$scope.success = $scope.error = null;
var user = new Users($scope.user);
user.$update(function (response) {
$scope.success = true;
Authentication.user = response;
}, function (response) {
$scope.error = response.data.message;
});
} else {
$scope.submitted = true;
}
};
}
]);