mardi 25 avril 2017

How do hiding other submenu except current submenu in angular?

I want to hiding other submenu, when using current submenu.

ex) A a a B // using a A B b b // using b

I worked below by mouseleave.

<li id="admin" class="sidebar-list" ng-mouseenter="option=true" ng-mouseleave="option=false">
    <a href="#/admin/security">Admin <span class="menu-icon fa fa-cog"></span></a>
    <ul class="admin-sub" ng-if="option==true">
      <li>
        <a href="#/admin/security"> - Admin Management</a>
      </li>
    </ul>
  </li>

but I want to modify this, In current submenu page open the current submenu. but It is not working. help me please.

  <li id="report" class="sidebar-list" ng-mouseenter="option1=true;option2=false;">
    <a href="#/reports/resource">Reports <span class="menu-icon fa fa-file-text-o"></span></a>
    <ul class="report-sub" ng-if="option2==true && toggle==true">
      <li>
        <a href="#/reports/resource"> - Resource</a>
      </li>
    </ul>
  </li>
  <li id="admin" class="sidebar-list" ng-mouseenter="option1=false;option2=true" ng-mouseleave="option2=false">
    <a href="#/admin/security">Admin <span class="menu-icon fa fa-cog"></span></a>
    <ul class="admin-sub" ng-if="option2==true">
      <li>
        <a href="#/admin/security"> - Admin Management</a>
      </li>
    </ul>
  </li>




Aucun commentaire:

Enregistrer un commentaire