I have written a custom method to do a call to my API passing some extra parameters, but I get the following error: TypeError test.testing is not a function. I followed the code in here: https://docs.angularjs.org/api/ngResource/service/$resource
This is the code I use, $save for example is working fine.
I am using version 1.4.1.
services.factory('Calendar',function($resource){
return $resource('/api/calendar/:id',{
update: {
method: 'PUT'
},
testing: {
method: "POST", params:{charge:true}
}
});
});
function( $scope, Calendar ) {
var test = new Calendar();
test.title = "hello";
test.$testing();
...
}
test.$testing()