This might be a dupe but I haven't found an answer that solves my problem exactly.
Lets say that I have 3 states.
account
account.settings
account.users
I want a link to be active on both childstates so I have a link like so
<a ui-sref="account" ui-sref-active="active"> And when i click this link, I want to redirect to the account.settings state. So I add a redirect in "onEnter", but that only triggers the first time I click the link. So I click the link and get redirected to the account.settings state, but if I click it again, onEnter doesn't trigger so i get flung to the account state, which is not what I want.
I've tried adding the logic in a state controller instead with the same result, I've also tried to use the $urlRouterProvider.when() function to redirect but I've run in to similar problems with that approach.
I feel as to I'm missing a point somewhere and I should have "gotcha" moment but I've been struggling with this a few days now and I can't seem to get it.