Daemonite / material

Material Design for Bootstrap 4
http://daemonite.github.io/material/
MIT License
3.2k stars 725 forks source link

Auto close the navdrawer on navigation to other link #274

Closed PackageDotJSON closed 2 years ago

PackageDotJSON commented 2 years ago

Hi, I am using the navdrawer and have certain routes that take the user to other components. I want to hide the navdrawer automatically after the user clicks on any of the given routes. I am using Angular for this purpose. I have tried using the jquery and used the following line of code as per one of the previous issues here and facing an issue.

Here's the code:

hideNavbar() { ($('#navdrawerDefault')).navdrawer('hide'); }

It is working but, my entire page reloads when the user clicks on one of the routes. Can you tell me how can I integrate that using Angular or, is there any changes to the library that auto closes the navdrawer after user clicks on it?

PackageDotJSON commented 2 years ago

I kinda resolved it by adding the following lines:

hideNavbar() { $('#navdrawerDefault').removeClass('show'); }