Angular: How to update queryParams without changing route

I am trying to update (add, remove) queryParams from a component. In angularJS, it used to be possible thanks to :

$location.search('f', 'filters[]'); // setter
$location.search()['filters[]'];    // getter

I have an app with a list that the user can filter, order, etc and I would like to set in the queryParams of the url all the filters activated so he can copy/paste the url or share it with someone else.

However, I don’t want my page to be reloaded each time a filter is selected.

Is this doable with the new router?

10 Answers
10

Leave a Comment