I am a newbie to ui-router , i would like to get a menu like below (its not a collapse thing, please see the plnkr )
-
menu1
a) submenu1
b) submenu2
c) submenu3
-
menu2
- menu3
I managed to get the menus and submenus using the ui-router but not sure about the proper way to use the ui-router and used ui-sref-active="active"
active the menu , the problem am facing is when I click on the submenu i would like to get the active to parent also.. ie if I click submenu1
, submenu2
or submneu3
i want to active its parent menu1
.
here is the plunker : http://plnkr.co/edit/1kpmUiacrb3Aoo4E19O1?p=preview
Best Answer
There is an updated plunker, which does use the
$state.includes
method as defined herethe changes are: menu gets controller which puts
$state
into$scope
:instead of this:
we have to use defintion with
ng-class
:BUT: this feature would be in a next
ui-router
release as we can see here:cite