title: Send data to a TemplateRef MatDialog
body: <p>How to get data sent to a MatDialog that is a <code>ng-template</code>?</p>
  
  <p><strong>Template</strong></p>
  
  <pre><code>&lt;button mat-button (click)="openDialog()"&gt;Open&lt;/button&gt;
  
  &lt;ng-template #dialogRef&gt;
      {{data?}} &lt;!-- &lt;&lt;&lt; Here is the problem data is undefined --&gt;
  &lt;/ng-template&gt;
  </code></pre>
  
  <p><strong>Component</strong></p>
  
  <pre><code>export class SomeComponent {
      @ViewChild("dialogRef") dialogRef: TemplateRef&lt;any&gt;;
  
      constructor(private dialog: MatDialog) { }
  
      openDialog(): void {
          this.dialog.open(this.dialogRef, { data: "some data" });
      }
  }
  </code></pre>