$location.search() to set an url
$location.search()
the search parameter which is passed to the search() is set by a form. selecting and deselecting an element ca
search()
Using the $location service, you can remove the search param by assigning it a null value:
$location
In the case when your parameter is null, in your case 'parameter' you can remove it from the url by assigning it a null value like;
'parameter'
$location.search('parameter', null);
Hope it helps.