I have an app with 2 states:
profile
settings
I have a link that repeats in my whole app:
<a ui-sref="profile({id:profile.id})" ui-sref-active="active">Current state + ID</a>
How can I change the ui-sref
to be dynamic? - to represent the current state along with the current stateParam that I want (which is id
)
when finding a solution, keep in mind that I want to be abble to use ui-sref-active
so I'd rather avoid ng-click on something like this.
I think ui-sref
will parse what is inside the ( and ) as an expression.
So all you have to do is this.
<a ng-repeat="step in steps" ui-sref="{{step.state}}(step.param)"></a>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With