Names of ui-sref parameters and state variables
I ended up in the same situation, I couldn’t do this either, try moving your code using ng-click and inside your ng-click function use $ stage.go and pass the parameters there, for example:
$scope.clickHandler = function(param){ $state.go('state.name',{myKey:param}); } How to pass parameters using ui-sref to ui-router for controller
A similar question was asked here. His solution was to configure a state that performs routing, and you pass parameters to this state through ui-sref, which runs the desired URL
I think the easiest solution is
<button ui-sref="myState({mykey:vm.key})"> Link </button> where vm.key is the value passed from the controller. This avoids the use of additional javascript used in the response. Its very similar to the accepted answer, but the variable is used in the html tag as is, without creating a handler.
Dynamic ui-sref not supported, but I found advice on using link generation with the href $ state service method :
<a href="{{ctrl.url(myState, myKey)}}> url = function(myState, myKey) { return $state.href(myState, {myKey: 'my variable type value'}); }