I created a WebServices to get query by string and return a list, example:
url / myPath / luiz - Since luiz is the parameter that will be passed, based on this parameter will return a luiz list.
In AngularJS with you: List All, Search by ID, Delete, Change and I can not pass a parameter as a string. Here is the code snippet:
reportServices.factory('MeuServico', ['$resource',
function($resource){
return $resource('/url/meuPath/:nome', {}, {
query: { method: 'GET', isArray: true },
queryParameter: { method: 'GET', params: {query: '@nome'} , isArray: true,}
});
}]);
AngularJS generates the url like this: /url/meuPath?0=%2F&1=a&2=b&3=e&4=r&5=t&6=a
As he generated in this way AngularJS discards what comes after the "?" and ends up falling on the service to list everyone.
Solution
My error occurred because of the following:
When I called the service I was doing this:
/url/meuPath/:nome
Being that I should call it like this:
/url/meuPath/nome
MeuServico.Query("Amarelão");
By doing this, the service can access the services of the service without generating the URL as if the parameter were an array