Files
InventoryTraker-Box/InventoryTraker.Web/js/profile/EditProfileController.js
T
2016-09-23 15:12:46 -04:00

28 lines
541 B
JavaScript

(function() {
'use strict';
window.app.controller('EditProfileController',
function($http, editProfileConfig, model) {
var vm = this;
vm.profile = model;
vm.save = save;
function save() {
vm.saving = true;
vm.errorMessage = null;
vm.success = false;
$http.post(editProfileConfig.saveUrl, vm.profile)
.success(function() {
vm.success = true;
})
.error(function(msg) {
vm.errorMessage = msg;
})
.finally(function() {
vm.saving = false;
});
}
});
})();