Files
InventoryTracker/InventoryTraker.Web/js/profile/profileSvc.js
T

32 lines
533 B
JavaScript

(function() {
window.app.factory("profileSvc",
[
"$http",
function($http) {
var profile = {};
loadProfile();
var svc = {
update: update,
profile: profile
};
return svc;
function loadProfile() {
$http.post("/Profile/Get")
.success(function(data) {
angular.copy(data, profile);
});
}
function update(updatedProfile) {
return $http.post("/Profile/Update", updatedProfile)
.success(function(data) {
angular.copy(data, profile);
});
}
}
]);
})();