I am using angular 1.4.8 and there is bug i thing with encode parameter in get request.
This is my service :
angular
.module('test')
.factory('User',User);
/* @ngInject */
function User($resource) {
return $resource('api/users/:login', {}, {
'query': {method: 'GET', isArray: false},
'get': {
method: 'GET',
transformResponse: function (data) {
data = angular.fromJson(data);
return data;
}
},
'save': {method: 'POST'},
'update': {method: 'PUT'},
'delete': {method: 'DELETE'}
});
}
and this when i use it:
return User.get({
page: 1,
size: 20,
sort: 'email asc' //THIS IS A PROBLEM
}
).$promise.then(function (data, headersGetter) {
return data.content;
});
My request is :
http://localhost:3000/api/users?page=0&size=10&sort=email+asc
But its should look like :
http://localhost:3000/api/users?page=0&size=10&sort=email%20asc
Why angular not properly encode that parameter ?? How to fix this issue ?