I have this service:
function fileManagerClient($resource, $http, $rootScope, dataService) { var userId = $rootScope.globals.currentUser.userId; var kpeId = $rootScope.kpeId; var fileName = "8888"; return $resource("api/file/:userId/:kpeId/:fileName", { fileName: "@fileName" }, { 'query': { method: 'GET', params: { userId: '@userId', kpeId: '@kpeId', fileName: fileName } }, 'save': { method: 'POST', params: { userId: userId, kpeId: kpeId, fileName: fileName }, transformRequest: angular.identity, headers: { 'Content-Type': undefined } }, 'remove': { method: 'DELETE', params: { userId: userId, kpeId: kpeId, fileName: fileName } } }); } And there is another service that calls the query, save, remove methods of the fileManagerClient service.
When I enter the page, the query method is called. Fulfills a method in WebApi and get an error
How to configure $resource to run all the methods (query, save, remove)?
isArray: false. I'll change the answer now. Just as a correct answer here, in my opinion, it doesn’t matter. There, even in the text of the error, they say that an array is expected and the object has come, or vice versa. - endovitskiiy