uksz uksz - 1 year ago 176
AngularJS Question

Angular UI Router: How to go to the same state with different $stateParam?

I am wondering how can I go to the same state, with different


I was trying to go with:

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

However, it was not working.

Answer Source

the params are second paramater of the go() method

$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).

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download