【发布时间】:2016-10-16 18:20:18
【问题描述】:
我知道我可以像这样更改页面时传递参数:
$state.go('index.my_route', {my_param : value});
然后:
function myCtrl($stateParams) {
console.log($stateParams.my_param);
}
但是我在 URL 中需要这个参数,然后我想知道如何将它与 URL 字符串一起传递并仍然调用 $state.go。像这样的:
$state.go('index.my_route?my_param=' + value);
> "http://localhost/#/index/my_route?my_param=123"
【问题讨论】:
标签: javascript angularjs routing angular-ui-router