I have an array of user ids. I want to pass user ids to $location.search
$scope.userIds = [1, 2];
$location.search({'userId[]' : $scope.userIds}).path('/search');
It give a URL
/search?userId%5B%5D=1&userId%5B%5D=2
if I remove %5B%5D unwanted chars then it works
How to remove them?