Check out this code snippet:
angular.module('app.posts.services', []).factory('Post', ['$resource', 'API_ENDPOINT', ($resource, API_ENDPOINT) =>
$resource(API_ENDPOINT, { id: '@id' }, {
update: {
method: 'PUT'
}
})
]).value('API_ENDPOINT', 'http://somedomainname.com/users/:user_id/posts/:id')
I need to modify the URL format for the update method to be "http://somedomainname.com/posts/:id". Any suggestions on how to achieve this?