angularjs - I used $location.search to set paramValue, but if i select other link also it get appended to new url, how to solve it -


in angularjs used $location.search() set paramvalue in url i.e

if change dropdown executesearch() called.

executesearch()  {   $location.search('type', task); }  result : index.html#/search?type=task. 

but if click on other link coming

index.html#/help?type=task 

how make specific function only..if click on other link ?type=task appended. how remove paramvalues("? folled paramvalues") if click on other links.

<select class="search-dropdown-select" ng-change="searchbar.executesearch()"                         ng-model="searchbar[item.model]"                         ng-options="item.name item in searchbar.{{item.options}}"></select> 

when clicking on other link use $location.url(). clear of query parameters.

function navigate(path) {   $location.url(path); }  

<a href ng-click="navigate('/help')">help</a>


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -