title: Angular Material2 SideNav onOpen on Close
body: <p>I'm making a webapplication using Angular 4 and material. I'm using the material "Sidenav" component. I'd like to trigger an event if the sidenav is opened or closed. By adding a function to the click property of the button the event is triggered. But if I close the sidenav by pressing escape or clicking somewhere outside the nav, the click event on the button is logically not working.</p>
  
  <p>There are two properties for the sidenav called <code>onOpen</code> and <code>onClose</code> but I don't understand how to use them. Or are they even the right properties to achieve what I want to do?</p>
  
  <p>Here a plunker for better understanding: <a href="http://embed.plnkr.co/ZPmhbFm1hbOUKYp1rV6J/" rel="nofollow noreferrer">http://embed.plnkr.co/ZPmhbFm1hbOUKYp1rV6J/</a></p>
  
  <p>The result should be an alert with "World" if the sidenav is closed by not pressing the button.</p>