Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ui-sref and variable state parameter names

I want to render a link such as:

<a ui-sref="myState({myKey: 'my variable type value'})">

where state name myState and key myKey are variables.

Is there a way to accomplish this?

like image 895
Yannis Avatar asked Oct 01 '14 14:10

Yannis


1 Answers

I found myself in the same situation, I couldn't acomplish that as well, try to move your code using ng-click and inside of your ng-click function use a $stage.go and pass the parameters there, something like:

$scope.clickHandler = function(param){
    $state.go('state.name',{myKey:param});
}
like image 129
pedrommuller Avatar answered Oct 03 '22 02:10

pedrommuller