0

I have use the Yeoman angular-fullstack generator and absolutely love it!

I'm trying to add a dropdown in the navbar. I found the navbar controller in Client/Components/Navbar/navbar.controller.js and added items to the menu object. This works fine for individual pages, however I cannot find any syntax on how to add a dropdown menu!

I'm sure this is an easy question to answer but I am struggling to find any relevant documentation.

Cheers

BOM
  • 1
  • 2

2 Answers2

0

Angular fullstack uses bootstrap. So you can use a bootstrap 3 drop-down menu where you would like your menu to be in the file that you found. If you go to http://getbootstrap.com/components/#dropdowns it's explained there.

rotato poti
  • 121
  • 1
  • 7
0

angularfulstack may use bootstrap 3, however, for dropdown you need to use ui-bootstrap way of doing things.

<li ng-show="$ctrl.isLoggedIn()" class="btn-group" uib-dropdown is-open="status.isopen">
    <a>
        <span id="single-button" type="button" uib-dropdown-toggle ng-disabled="disabled">
          <span class="glyphicon glyphicon-cog"></span>
        </span>
    </a>
    <ul class="dropdown-menu" uib-dropdown-menu role="menu" aria-labelledby="single-button">
        <li ng-show="$ctrl.isAdmin()" ui-sref-active="active"><a ui-sref="users"><span class="fa fa-address-card-o"></span> Users</a></li>
        <li ng-show="$ctrl.isAdmin()" ui-sref-active="active"><a ui-sref="dashboard"><span class="fa fa-dashboard"></span> Dashboard</a></li>
        <li ng-show="$ctrl.isAdmin()" class="divider"></li>
        <li ng-show="$ctrl.isLoggedIn()" role="menuitem" ui-sref-active="active"><a ui-sref="company"><span class="fa fa-gears"></span> Company Information</a></li>
    </ul>
</li>
Derek Carr
  • 73
  • 1
  • 7