Jordan-Hall / angular-material-rail-drawer-plugin

Angular Material extension for mini/rail drawer variant
Other
47 stars 13 forks source link

Current mode (mini/expanded) API variable #8

Closed enlight3d closed 4 years ago

enlight3d commented 4 years ago

Hello, is there any API variable that can tell programatically if the drawer is in mini or expanded mode ? I've seen that you've added APIs that I were searching for yesterday so maybe you have this one too ?

Jordan-Hall commented 4 years ago

Hi @enlight3d,

This supports all of Angular Material native API https://material.angular.io/components/sidenav/api#MatDrawer So you can even use the output event or use the opened property

one example to show both: <mat-sidenav #appDrawer mode="rail" opened="true" (openedChange)="openedChange(appDrawer.opened)">

Jordan-Hall commented 4 years ago

I've just updated the read me to include a link to Angular Material API properties as we do not effect the underlying functionality.

close === mini opened === expanded

enlight3d commented 4 years ago

Thanks a lot for this explanation. Was concerned that close could have been just "closed" because last time when I put "opened=false" thinking it would start in mini mode and not expanded, the sidebar just didn't appear at all.

Jordan-Hall commented 4 years ago

Thank you for raising the opened=false bug. Will look into it shortly.

enlight3d commented 4 years ago

you're welcome

Jordan-Hall commented 4 years ago

Fixed in version 0.0.6. Think i'll be making it a solid version in the next couple of weeks

https://github.com/Jordan-Hall/angular-material-rail-drawer-plugin/pull/9

enlight3d commented 4 years ago

Great ! Thank you