I'm trying to properly encode query params on angular with the code below:
getAccount = function (accountEmail, accountCreationDate) {
var data = {
accountEmail: accountEmail,
accountCreationDate: accountCreationDate
};
return $http.get('/administration/account.json', {params: $filter('noBlankValues')(data)}).then(
function (result) {
$log.debug('getAccount result: ' + JSON.stringify(result.data));
return result.data.result;
}
);
};
accountCreationDate is an ISO-8601 string (e.g. "2014-03-20T14:56:01.691+01:00"). According to http://docs.angularjs.org/api/ng/service/$http I'm passing params as an object, but in the frame I've the following "strange" query output:
?accountCreationDate=2014-03-20T14:56:01.691%2B01:00&[email protected]
i.e. the date '+' was encoded but not the rest of the object. Do you have any idea of what is going wrong and how to fix that?
PS: I know I can write manually the encoded query string, but I'm looking a more user-friendly solution.