加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

angularjs – 使用Ui-Router的ui-sref只是设置查询参数

发布时间:2020-12-17 07:41:59 所属栏目:安全 来源:网络整理
导读:我有以下链接 a ui-sref="..."Clicking this adds ?test=true to the query params./a 有没有办法使用ui-sref属性来更改查询参数而不重新加载页面或指向另一个函数? 你应该能够通过将参数传递给状态来实现. 尝试:- a ui-sref="yourStateName({test:true})"
我有以下链接
<a ui-sref="...">Clicking this adds ?test=true to the query params.</a>

有没有办法使用ui-sref属性来更改查询参数而不重新加载页面或指向另一个函数?

你应该能够通过将参数传递给状态来实现.

尝试:-

<a ui-sref="yourStateName({test:true})">Clicking this adds ?test=true to the query params.</a>

Usage:

ui-sref=’stateName’ – Navigate to state,no params. ‘stateName’ can be any valid absolute or relative state,following the same syntax rules as $state.go()

ui-sref=’stateName({param: value,param: value})’ – Navigate to state,with params.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读