title: Angular 5 Dynamic template in MatDialog
body: <p>in my component I open a MatDialog and pass data to it. In my object data.obj is under this.data.obj.html html-code stored.</p>
  
  <p>In electron I would use a webview to display the html-site.</p>
  
  <p>How do I display the html-code in proper way in my MatDialog in angular 5? Its possible to create the template dynamically or is there any smoother way?</p>
  
  <pre><code>@Component({
    selector: 'dialog-popup',
    template:`
    &lt;h1 mat-dialog-title&gt;Content-HTML&lt;/h1&gt;
    &lt;mat-dialog-content&gt;
    {{this.data.obj.html}}
    &lt;/mat-dialog-content&gt;
    &lt;mat-dialog-actions&gt;
      &lt;button mat-button&gt;Complain&lt;/button&gt;
      &lt;button mat-button (click)=onNoClick()&gt;Cancel&lt;/button&gt;
    &lt;/mat-dialog-actions&gt;
  `
  })
  export class DialogOverview {
  
    constructor(
      public dialogRef: MatDialogRef&lt;DialogOverview&gt;,
      @Inject(MAT_DIALOG_DATA) public data: any) { }
  
      ngOnInit() {
      console.log(this.data.obj.html);
      }
    onNoClick(): void {
  
      this.dialogRef.close();
    }
  
  }
  </code></pre>