Now can anyone explain that how I can use these custom methods? I know about the basic methods of resource and how to use them but this thing is confusing.
app.factory('ResouceService', ['$resource', '$window',
function($resource, $window) {
return {
request: function($url) {
return $resource($url + ':id', {}, {
query: {
method: 'POST',
data: {},
isArray: false
},
get: {
method: 'GET'
},
remove: {
method: 'DELETE'
},
edit: {
method: 'POST',
data: {},
isArray: false
},
add: {
method: 'PUT',
data: {},
isArray: false
}
});
}
}
}
]);