Last active
August 29, 2015 14:17
-
-
Save JonathanZWhite/058659d0938a731f48ee to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
UserModel.$inject = '$resource'; | |
function UserModel($resource) { | |
var baseUrl = 'api/user/:dest'; | |
var User = {}; | |
var userMethods = $resource(baseUrl, {}, { | |
get: { | |
method: 'GET', | |
dest: 'get' | |
}, | |
save: { | |
method: 'PUT', | |
dest: 'save' | |
} | |
}); | |
User.get = userMethods.get; | |
User.save = userMethods.save; | |
return User; | |
} | |
angular | |
.module('services.UserModel', []) | |
.factory('UserModel', UserModel); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment