For instance, let's say I have the following URL: http://local.com/
. When I invoke the function in my SearchController
, I aim to set text=searchtext
and generate a URL like this:
http://local.com/?text=searchtext
.
Is there a way to achieve this? I attempted using
$location.search('text', 'value');
but ended up with the URL: http://local.com/#/?text=searchtext
$scope.searchTracks = function() {
Search.search.get($scope.params, function(data) {
/** Set params in query string */
$location.path('/').search('text', $scope.text);
}
);
}