Angularjs $routeParams显示Url变量参数

Angularjs $routeParams显示Url变量参数,angularjs,routes,angularjs-ng-route,Angularjs,Routes,Angularjs Ng Route,我正在尝试使用routeProvider创建搜索页面。下面我有这样一个例子: }).when("/search/:value", { templateUrl: "app/views/search/search.html" 我想在url中显示的不是 /search/searchValue 但更像 /search/value=searchValue 我将位置设置为: $location.path('/search/').search({value:$scope.filter

我正在尝试使用routeProvider创建搜索页面。下面我有这样一个例子:

    }).when("/search/:value", {
        templateUrl: "app/views/search/search.html"
我想在url中显示的不是
/search/searchValue
但更像
/search/value=searchValue

我将位置设置为:

$location.path('/search/').search({value:$scope.filterValue});其中$scope.filterValue是搜索值。

当我使用此选项时,由于
:值
,我无法查看我的页面。我如何才能将url更改为我想要的url,就像您在url链接中显示routeParam一样


谢谢,

我所要做的就是使用/search/?。“?”后面的值是参数。

什么时候(“/search/?value”
location.search方法将searchValue发送到value是否有效?什么是“有效”。它怎么可能是“无效的”?是的,应该是。您测试过它吗?尝试不链接它们,$location.path(“/search/”);$location.search({value:$scope.filterValue});