according to the docs i can define custom actions for each resource. This is the REST API resource I was interested in configuring (see postman import link):
http://0.0.0.0:9000/api/properties_by_address
method: POST
post data: raw json:
{
"address" : "%address%"
}
setting up the resource in my services (i called it search, see js equivalent):
window.API_HOST ="http://localhost:9000/api/";
angular.module("app.services", [])
.factory("Properties", [
"$resource"
($resource) ->
$resource API_HOST + "properties/:id", null,
search:
method: 'POST'
url: API_HOST + 'properties_by_address'
params:
hello: 'good world'
address: 'good address'
])
I try to call this in a directive like so (see this for js conversion):
.directive('homeSearch', ['Properties', (properties) ->
restrict: 'AEC'
replace: false
templateUrl: '/partials/home_search.html'
link: (scope, elem, attrs) ->
button = elem.find('.button')
button.bind "click", ->
console.log "address searched" + scope.address
properties.search {}, address: scope.address
return
])
weird stuff happens here.. first of all instead of making the mothod call 'POST' it uses 'OPTIONS' instead.. further.. it only uses the parameters set up in the default definition (ie good world, good address.. instead of the scope.address value.. which i tested to be valid) see the summary of the request/response in this chrome devtools screenshot:

questions: - how do i make the service use the parameters that I use when i call it? - how do i specify that it takes the parameters as post JSON data.. rather than appending it to the query string?