EC2Restangular.setBaseUrl('localhost:9000/');
EC2Restangular.setDefaultRequestParams({
"Id": ID
});
Is there any way to remove default query params from baseUrl in Restangular?
EC2Restangular.setBaseUrl('localhost:9000/');
EC2Restangular.setDefaultRequestParams({
"Id": ID
});
Is there any way to remove default query params from baseUrl in Restangular?
To remove the parameters you can just pass an empty object:
EC2Restangular.setDefaultRequestParams({});
If you want to remove the request parameters from a single request, you can add the empty object to the method call like so:
Restangular.all("widget").getList({})
Update: To remove a specific paramter from the default parameter set is a little trickier.
We can grab the parameter list from the Restangular object, and then use that to remove the parameter we don't need, and then use that new parameter object to pass to the new request: