I want to call URL with special charecters in query parameter using Restangular customGET
method. I am using Loopback for my API, which uses square brackets for query. It seems it's not allowed in Restangular.
I want to call following URL.
/api/v1/employees/findOne?filter[where][salesCode]=SC2
or this but not sure how.
/api/v1/employees?filter[where][salesCode]=SC2
I tried following with no success.
Restangular.all("employees").customGET("findOne", {filter + "%5Bwhere%5D%5BsalesCode%5D": newValue});
and
Restangular.all("employees").customGET("findOne", {filter[where][salesCode]: newValue});
As a work around I am using $http
but a hack is a hack end of the day.
You should do:
Restangular.all("employees").customGET("findOne", {"filter[where][salesCode]": newValue});
That should do it :).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With