1

I use AngularJS ui-router and I have the problem that I habe a submenu which i reachable from menu1 and menu2. Is it possible anywhere to highlight either Menu1 or Menu2?

Menu1: ng-class="{'active': vm.state.includes('auth.Menu1') || vm.state.includes('auth.SubMenu')}"
Menu2: ng-class="{'active': vm.state.includes('auth.Menu2') || vm.state.includes('auth.SubMenu')}"
vittore
  • 17,449
  • 6
  • 44
  • 82
quma
  • 5,233
  • 26
  • 80
  • 146
  • Possible duplicate of [Adding Angular directive using decorator](http://stackoverflow.com/questions/34686823/adding-angular-directive-using-decorator) – vittore Jan 13 '16 at 19:27
  • What about http://stackoverflow.com/questions/17215656/how-to-detect-current-state-within-directive/17225152#17225152 – Sean Larkin Jan 13 '16 at 19:27
  • @SeanLarkin there are other questions not just these two – vittore Jan 13 '16 at 20:37

1 Answers1

1

People keep asking this question, you should use ui-sref-active directive

vittore
  • 17,449
  • 6
  • 44
  • 82