我想知道如何使用不同的$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/