I setup API base url in Main.js with query param "advertiserId". I would like to remove the query param advertiserId
in Demo.js. Note I don't want to use $location
search params (since these are search params from current window URL not the URL I constructed).
Main.js:
Restangular.setBaseUrl("localhost:9000/advertisers");
Restangular.setDefaultRequestParams({
"advertiserId": advertiserID
});
Demo.js
Restangular.RemoveRequestParams({
"advertiserId": advertiserID
});
You can parse any url with this:
EDIT: To remove everything after (and including) the
?
you can use this: