将URL参数传递给ui-sref

时间:2015-03-26 08:38:22

标签: javascript angularjs angular-ui-router

我需要将查询参数传递给我的网址

<a ui-sref="customers({foo:'bar'})">Link</a>

foo不是状态参数,应解析为常规查询参数

<a href="#/customers?foo=bar">Link</a>

我该怎么做?

1 个答案:

答案 0 :(得分:0)

为了做到这一点:

<a ui-sref="customers({foo:'bar'})">Link</a>

你需要这样的东西:

$stateProvider.state("customers", {url: "customers?foo", ...});
相关问题