There is a working plunker
I would say that we can use a combination:
$state.href() (doc here ) andng-href (doc here )
(but only if the parameters passed are part of the url)
It will be the result.
<a ng-href="{{$state.href(myStateName, myParams)}}">
And now (in plunker ) we can change myStateName to parent , parent.child , home and it will correctly change the generated href:
<input ng-model="myStateName" /> <input ng-model="myParams.param" />
Because these are states in plunker
$stateProvider .state('home', { url: "/home", ... }) .state('parent', { url: "/parent?param", ... }) .state('parent.child', { url: "/child", ...
Check here
Radim Köhler May 05 '15 at 16:53 2015-05-05 16:53
source share