title: AngularJS multilevel dropdown menu for a menu structure generated from a recursive directive
body: <p>I have a dilly of a pickle here.
  I have to get my multi-level navigation menu from a webservice call.</p>
  
  <p>Since my navigation menu can have an infinite amount of submenu's in it, I had to use a recursive directive to build my parent/child navigation structure.
  Now I am trying to figure out how to turn it into a functional dropmenu structure.
  I was taking a look at angularui-bootstrap, and they have a 
  Dropdown Toggle, which has some basic dropmenu functionality, but since 
  I used a recursive directive my menu structure already has angularjs generated css
  classes attached to them.  The angularjs-bootstrap dropmenu's have
  css classes which are different than my angularjs generated classes....behold!</p>
  
  <pre><code>&lt;ul&gt;
      &lt;li ng-repeat="parent in parents" class="ng-scope"&gt;
          &lt;recursive-list-item on-node-click="onNodeClickFn(node)" parent="parent" class="ng-isolate-scope ng-scope"&gt;
              &lt;a data-ng-click="onNodeClick({node: parent})" href="javascript:void(0)" class="ng-scope ng-binding"&gt;Clothes&lt;/a&gt;
              &lt;!-- ngIf: parent.children.length &gt; 0 --&gt;
              &lt;ul data-ng-if="parent.children.length &amp;gt; 0" class="ng-scope"&gt;
                  &lt;!-- ngRepeat: child in parent.children --&gt;
                  &lt;li ng-repeat="child in parent.children" class="ng-scope"&gt;
                      &lt;recursive-list-item data-on-node-click="onNodeClickFn(node)" data-parent="child" class="ng-isolate-scope ng-scope"&gt;
                          &lt;a data-ng-click="onNodeClick({node: parent})" href="javascript:void(0)" class="ng-scope ng-binding"&gt;Gortex Jackets&lt;/a&gt;
                          &lt;!-- ngIf: parent.children.length &gt; 0 --&gt;
                      &lt;/recursive-list-item&gt;
                  &lt;/li&gt;
                  &lt;!-- end ngRepeat: child in parent.children --&gt;
                  ...
                  ...
                  ...
              &lt;/ul&gt;
          &lt;/recursive-list-item&gt;
      &lt;/li&gt;
      &lt;!-- end ngRepeat: child in parent.children --&gt;
  ...
  ...
  &lt;/ul&gt;
  </code></pre>
  
  <p>That was an example of the html that is generated as the final output for my recursive navigation menu. Having it set up this way all submenu's ng-click's are active, and they have the same scope as the main controller (all is dandy except it doesn't look like a dropmenu)</p>
  
  <p>Here is an example of the dropmenu structure for angularjs-bootstrap</p>
  
  <pre><code>&lt;li class="dropdown" ng-controller="DropdownCtrl"&gt;
    &lt;a class="dropdown-toggle"&gt;
      Click me for a dropdown, yo!
    &lt;/a&gt;
    &lt;ul class="dropdown-menu"&gt;
      &lt;li ng-repeat="choice in items"&gt;
        &lt;a&gt;{{choice}}&lt;/a&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  </code></pre>
  
  <p>It has very much different css class structure than mine, so angularjs-bootstrap's 'dropdown' won't work with mine.</p>
  
  <p>Does anyone have any suggestions for me?  Keep in mind that since I am getting my navigation structure via json via a webservice call I have to use recursive angularjs in order to create the parent/child menu structure.</p>
  
  <p>If anyone is confused about my directive html generated here I can show my custom directive code, but will not unless asked for brevity.  My custom directive code works for just building the navigation structure, and keeps all the directive scopes connected to the main controller's scope (ie: click active), but it is not styled/scroll active.</p>
  
  <p><img src="https://i.stack.imgur.com/0sBkR.jpg" alt="My Non Functional Menu Navigation"></p>
  
  <p>*****UPDATE********
  I have created a plunker replication that is almost the same.
  In my project I was getting my navigation menu data from an angularjs service,
  which would make a webservice call to a rest webservice on my server, but I don't have that here, so I just manually created the json for each one of my services that makes REST webservice calls.
  The important part is the recursive directive.
  Right below you will find the link to the plunker project.
  Can someone help me out?</p>
  
  <p><a href="http://plnkr.co/edit/KHfZ5N?p=preview" rel="nofollow noreferrer">Plunker Project</a>  -------------------------------------------------------------</p>
  
  <p>*************NEWER UPDATE*****************
  Comment from Charlietfl that I can just have multiple css classes in my navigation dropmenu structure. I am attempting this with angularui-bootstrap.  I followed the instructions for adding this to my project and created a new Plunker project based on the old plunker project, but with the extra dropmenu css classes added to the navigation structure. Here is the Plunker Project:   <a href="http://plnkr.co/edit/f0H3Yg?p=preview" rel="nofollow noreferrer">Plunker Project</a></p>
  
  <p>The navigational elements still show up in the DOM but they are not visible.
  I looked at the css for the first ul element and it is as such:</p>
  
  <pre><code>*, *:before, *:after {
      -moz-box-sizing: border-box;
  }
  *, *:before, *:after {
      -moz-box-sizing: border-box;
  }
  .dropdown-menu {
      background-clip: padding-box;
      background-color: #FFFFFF;
      border: 1px solid rgba(0, 0, 0, 0.15);
      border-radius: 4px;
      box-shadow: 0 6px 12px rgba(0, 0, 0, 0.176);
      display: none;
      float: left;
      font-size: 14px;
      left: 0;
      list-style: none outside none;
      margin: 2px 0 0;
      min-width: 160px;
      padding: 5px 0;
      position: absolute;
      top: 100%;
      z-index: 1000;
  }
  </code></pre>
  
  <p>It was obtained from the official bootstrap css file.
  Not sure exactly why it's not visible.
  Not sure if it will help, but here is the css for the very next li element after the ul</p>
  
  <pre><code>*, *:before, *:after {
      -moz-box-sizing: border-box;
  }
  *, *:before, *:after {
      -moz-box-sizing: border-box;
  }
  .dropdown {
      position: relative;
  }
  .dropup, .dropdown {
      position: relative;
  }
  li {
      line-height: 20px;
  }
  *, *:before, *:after {
      -moz-box-sizing: border-box;
  }
  </code></pre>
  
  <p>Keep in mind that you have to go to the plunker page to see the updated code starting from when I added the css tags needed for angularui-bootstrap.
  To see the invisible navigational elements you will need something like Firebug to see the DOM.</p>
  
  <p>Here is an example of some html final output (from the DOM) from my update to try and work with angularui-bootstrap css classes.</p>
  
  <pre><code>...
  &lt;li ng-repeat="child in parent.children" class="dropdown ng-scope"&gt;
              &lt;recursive-list-item data-on-node-click="onNodeClickFn(node)" data-parent="child" class="ng-isolate-scope ng-scope"&gt;
              &lt;a class="dropdown-toggle ng-scope ng-binding" href="javascript:void(0)"&gt;Kids Clothes&lt;/a&gt;
  ...
  </code></pre>
  
  <p>I suspect that the reason the angularui-bootstrap libary is not working is because of the     "recursive-list-item.." element that is a child element of the "li" element, and parent element to the "a" element. Is this hunch of mine correct?</p>