I have set up a sidenav that collapses when the window is smaller than 1280px using this code:
md-is-locked-open="$mdMedia('gt-md')"
. However, I would like to add a menu icon (Hamburger button) that appears when the sidenav collapses, allowing users to click on it and display the menu. I haven't written any JavaScript for this yet.
The current behavior is similar to the left Sidenav in Angular Material's demo.
<div id="menu-icon">
<svg ng-click="showMenu()" fill="#FFFFFF" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg">
<path d="M0 0h24v24H0z" fill="none" />
<path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" />
</svg>
</div>
<md-sidenav ng-cloak id="main-layout-sidebar" class="md-sidenav-left md-whiteframe-z2" layout="column" md-component-id="left" md-is-locked-open="$mdMedia('gt-md')">
<div ng-cloak class="user-options">
<div class="content">
<div id="user-icon">
<md-icon class="picture" md-font-set="material-icons"> account_circle </md-icon>
</div>
<div id="user-info">
<p id="username">{{username}}</p>
<md-button ng-click="logout()">Cerrar sesión </md-button>
</div>
</div>
</div>
<md-list ng-cloak class="menu">
<md-list-item ng-repeat="(name, uiref) in items" ng-class="{ active: $state.includes({{uiref}}) }">
<a ui-sref={{uiref}}>
<md-button class="sidebar-button">
{{name}}
</md-button>
</a>
</md-list-item>
</md-list>
</md-sidenav>
I am looking for guidance on how to achieve this desired behavior. Any suggestions?