title: Angular Universal MatDialog appears empty and buttons don't work
body: <p>I have ported an Angular Material 5 app over to Angular Universal, and I have an intermittent issue with a MatDialog that I'm using. When it opens, there's no title or content. Only the OK and Cancel buttons appear, and they don't work.</p>
  
  <p><a href="https://i.stack.imgur.com/L7lvQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/L7lvQ.png" alt="MatDialog appears empty"></a></p>
  
  <p>I'm using a service to create the dialog. Here's the code.</p>
  
  <pre><code>import { Observable } from 'rxjs/Observable';
  import { MatDialogRef, MatDialog, MatDialogConfig } from '@angular/material';
  import { Injectable } from '@angular/core';
  
  import { AppConfirmComponent } from './app-confirm.component';
  
  @Injectable()
  export class AppConfirmService {
  
    constructor(private dialogRef: MatDialog) { }
  
    public confirm(title: string, message: string, id: string): Observable&lt;boolean&gt; {
      const idCancel = id + '-cancel';
      let dialogRef: MatDialogRef&lt;AppConfirmComponent&gt;;
      dialogRef = this.dialogRef.open(AppConfirmComponent, {
        width: '300px',
        disableClose: true,
        data: {title, message, id, idCancel}
      });
      return dialogRef.afterClosed();
    }
  }
  </code></pre>
  
  <p>And the component:</p>
  
  <pre><code>import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
  import { Component, Inject } from '@angular/core';
  
  @Component({
    selector: 'app-confirm',
    template: `&lt;h1 matDialogTitle&gt;{{ data.title }}&lt;/h1&gt;
      &lt;div mat-dialog-content&gt;{{ data.message }}&lt;/div&gt;
      &lt;div mat-dialog-actions&gt;
        &lt;button id="{{ data.id }}" type="button" mat-raised-button color="primary"
          (click)="dialogRef.close(true)"&gt;OK&lt;/button&gt; &amp;nbsp;
        &lt;span fxFlex&gt;&lt;/span&gt;
        &lt;button id="{{ data.idCancel }}" type="button" color="accent" mat-raised-button
          (click)="dialogRef.close(false)"&gt;Cancel&lt;/button&gt;
      &lt;/div&gt;`,
  })
  export class AppConfirmComponent {
    constructor(
      public dialogRef: MatDialogRef&lt;AppConfirmComponent&gt;,
      @Inject(MAT_DIALOG_DATA) public data: any
    ) {}
  }
  </code></pre>