title: Dynamically load a component inside a Material MatDialog
body: <p>Can anyone provide an example of how to dynamically load a component into a Material MatDialog?  </p>
  
  <p>What I would like to do is this: I will provide the MatDialog configuration data with a  component Type which the dialog would then create an instance of and place inside it's mat-dialog-content area.</p>
  
  <p>It appears I would need to use some combination of ng-template and viewContainerRef, but I do not know how to instantiate the provided component Type and insert into the desired area.</p>
  
  <p>A simple example:</p>
  
  <pre><code>    &lt;h2 mat-dialog-title&gt;MyTitle&lt;/h2&gt;
      &lt;mat-dialog-content&gt;
       &lt;---- dynamically loaded component would be inserted here ----&gt;
      &lt;/mat-dialog-content&gt;
  
      &lt;mat-dialog-actions&gt;
        &lt;button mat-button mat-dialog-close&gt;Cancel&lt;/button&gt;
        &lt;button mat-button [mat-dialog-close]="true"&gt;Save&lt;/button&gt;
      &lt;/mat-dialog-actions&gt;
  </code></pre>