I'm just starting to use ngResource in a project to consume my RESTful endpoints. Is this how you would implement a user password reset using $resource? Looks weird passing the email address as a URL parameter.
.factory('User', ['$resource', function ($resource) {
var paramDefaults = {id: '@id'}
var actions = {
passwordReset: {
method: 'GET',
params: {email: '@email'},
url: '/api/user/reset/:email'
}
}
return $resource('/api/user/:id', paramDefaults, actions);
}])
yes, looks a little bit weird. Instead of GET I will use POST request to reset the password and pass the email param in request body