How do I hide the sidenav when an menuitem is clicked?


Topic: How do I hide the sidenav when an menuitem is clicked?

Oskar Helling asked 6 years ago

How do I make the sidenav hide after the user has clicked an item?


Arkadiusz Idzikowski staff answered 6 years ago

You need to add template reference variable to the sidenav component and use sidenav.hide() method on the link click. For example:

<mdb-side-nav #sidenav></mdb-side-nav>

<a (click)="sidenav.hide()"></a>

Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Resolved

Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: 7.5.0
  • Device: Computer
  • Browser: Chrome
  • OS: macos
  • Provided sample code: No
  • Provided link: No
Tags