I'm creating a navigation sidebar for an application in AngularJS. The structure is basically a tree menu, however each level has different interactions (which I will still build). For example, the first and second levels will only show and hide the content when clicked, with animation and all, while third, depending on a parameter, will enable or disable a collapse effect. Here is the structure of the menu:
- President
- Dilma
- Aetius
- Marina
- Luciana Genro
- Governor
- Alckmin
- Skaf
- Padilla
- Senator
- Member
- Federal Deputy
- Tirirca
- Russomano
- Feliciano
- State Representative
- Tiled
- Tripoli
- Capez
- Federal Deputy
Each of these items can open a link or expand the child menu. For example, clicking "Senator" would link to the senate composition, while the other items would expand the list to another side menu and the child elements of this list would have the effect of "collapse", when selecting one, hide the other.
This is what I have been able to develop so far: link
<leftnav pins="true" collapsable="true" labels="true"></leftnav>
I would like to pass the labels
parameter to enable icons on the first level, the pins
parameter for the second level and collapsable
for the third level. Is this possible?
The select()
and isSelected()
functions work, why collapse()
, isCollapsed()
, and foo()
do not work on the third level? I had to use the require: '^leftnav'
attribute in the directives because otherwise you would create different instances of controllers for each menu item, so when you select one option, you would not hide the others. Is there another way to do this?