title: Angular Material: Open mat-sidenav from mat-dialog or @component
body: <p>I've been searching for quite a while for a solution for this so any help would be great.</p>
  
  <p>I'm using Angular Material 2 and I want to use the <code>.open()</code> method for a <code>mat-sidenav</code> by pressing a button in a <code>mat-dialog</code> or just when the dialog closes.</p>
  
  <p>According to the documentation I think I can tag the <code>mat-sidenav</code> element with <code>#sidenav</code> (or something) and then put <code>(click)="sidenav.open()"</code> in the button element. However, it isn't working (I read it might have something to do with different z-planes?). </p>
  
  <p>It looks something like this:</p>
  
  <p>sidenav.html</p>
  
  <pre><code>&lt;mat-sidenav-container&gt;
    &lt;mat-sidenav #sidenav opened="false"&gt; ... &lt;/mat-sidenav&gt;
  &lt;/mat-sidenav-container&gt;
  
  &lt;button mat-button (click)="openDialog"&gt;&lt;/button&gt;
  </code></pre>
  
  <p>dialog.html</p>
  
  <pre><code>&lt;button mat-button (click)="sidenav.open()"&gt;Open Sidenav&lt;/button&gt;
  </code></pre>
  
  <p>The dialog opens and closes fine and so does the sidenav (via a different button).</p>
  
  <p>I'm sure there's a way to open a sidenav from the @component but I haven't figured out how after trying several methods.</p>
  
  <p>Thanks</p>
  
  <p><strong>Edit</strong>: I should have said that I'm pretty new to Angular 2+ so if you could include a code snippet with an answer I'd appreciate it.</p>