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

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


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


You might want to use this piece of code:

<a ui-sref=".({param: 0})"></a>