title: Pass data from mat dialog back to component
body: <p>So, this popup opens and I can write any data in textArea but unfortunately, on clicking Submit button pop up not closing and I am not getting value in ts file.
  If I click outside the popup box I am getting Undefined value in TS.</p>
  
  <p>I need solution for this.
  1. Why TextArea Data not transferred into TS File ?
  2. Popup must close after writing any data in TextArea and On-clicking button, Prevent the user clicking other portion of the Screen.</p>
  
  <p>My ts Code is :</p>
  
  <pre><code>if(cnfrm){
  let dialogRef = this.dialog.open(this.callAPIDialog)
    dialogRef.afterClosed().subscribe(result =&gt; {
    console.log(`Dialog result: ${result}`); // which will be value
  })
  }
  </code></pre>
  
  <p>My html code is:</p>
  
  <pre><code> &lt;ng-template #callAPIDialog&gt; 
      &lt;textarea #name matInput placeholder="Leave a comment" formControlName="description" required&gt;&lt;/textarea&gt; 
      &lt;button type="button" (click)="dialogRef.close(name.value)"&gt;Submit&lt;/button&gt; 
    &lt;/ng-template&gt;
  </code></pre>