Let\'s say I have a RESTful endpoint that accepts a range of facets to query data. Here\'s a few examples:
example.com/search?type=Doctor&location=Boston
For the example above, the path() of your $location would be
'/search'
and the root is
'http://example.com'
Going back to his question, he did not ask to update the location with new path, he asked to update the location with new key-value pairs query dynamically!
So to do that, it's just everyday jQuery $x(newX)!
$location.search({type: x, location: y, radius: z});
or
$location.search({type: x, location: y});
It's all jQuery !!
If he wants to change the path from search to something else, he can do:
$location.path('/otherPath');
//his new location would be 'example.com/otherPath'