angularjs - Angular UI路由器: How to go to the same state with different $stateParam?

标签 angularjs angular-ui-router state

我想知道如何使用不同的$stateParam进入相同的状态?

我试图去:

$state.go('^.currentState({param: 0})')

但是,它不起作用。

最佳答案

参数是go()方法的第二个参数

$state.go('^.currentState', {param: 0})
go(to, params, options)

Convenience method for transitioning to a new state. $state.go calls $state.transitionTo internally but automatically sets options to { location: true, inherit: true, relative: $state.$current, notify: true }. This allows you to easily use an absolute or relative to path and specify only the parameters you'd like to update (while letting unspecified parameters inherit from the currently active ancestor states).

关于angularjs - Angular UI路由器: How to go to the same state with different $stateParam?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33672755/

相关文章:

angularjs - 将多个 ui-view 动画化为一个的最佳实践

angularjs - 是否可以为同一个 View 使用两个 Controller ?最好用ui-router

javascript - 从 AngularJS 工厂返回函数

javascript - ngMessage 在 AngularJs 中不起作用

javascript - ng-repeat 内的 angularjs ng-model 性能较差

Jquery 按复选框状态对表列进行排序

Python tkinter 禁用按钮,直到所有字段都被填满

javascript - AngularJS 中的多个 View 、多个解析但针对一个 Controller

angularjs - 有没有办法可以简化 angular-ui-router 解析?

listview - 如何使用 React-Native 获取父 ListView 组件中子复选框组件的状态?