title: Angular Material Dialog - Edit value on dialog should not update on table row automatically
body: <p>I am not much familiar with Angular Material. But in my new application, I am using it and now I am facing some challenges with dialog.</p>
  
  <p>I have a table with multiple rows and there I want to do an edit on it.
  When I click on Edit a dialog box should open and I should able to edit the data. 
  There are two action buttons say <strong>Cancel</strong> and <strong>Update</strong>.</p>
  
  <p>Update should save the data, close the dialog box and display updated data on the table.</p>
  
  <p>Cancel should simply close the dialog box.</p>
  
  <pre><code>&lt;div *ngFor="let attachment of doc.attachments; let i = index" fxFlex="grow" fxLayout="row" &gt;
      &lt;div fxFlex="auto"&gt;{{attachment.note}}&lt;/div&gt;
      &lt;button mat-menu-item (click)="editAttachmentNote(attachment)"&gt; 
           &lt;span&gt;Edit&lt;/span&gt;
      &lt;/button&gt;    
  &lt;/div&gt;
  
  openEditDialog(attachment): void {
      let dialogRef = this.dialog.open(AttachmentComponent, {
          data: { attachment: attachment }
      });
  
      dialogRef.afterClosed().subscribe((result: any) =&gt; {
          console.log(result);
          if(result){
              this.doc = result;
          }
      });
  }
  
  editAttachmentNote(attachment) {
      this.openEditDialog(attachment);
  }
  </code></pre>
  
  <p>=== attachment component ===</p>
  
  <pre><code>export class AttachmentUploadComponent {
        constructor(public dialogRef: MatDialogRef&lt;AttachmentComponent&gt;,
                  @Inject(MAT_DIALOG_DATA) public data: any,
                  private http: HttpClient) {
  
            if(!data.attachment) {
                 data.attachment = new AttachmentDto();
                 this.disableUpload  = false;
            }
            else {
                 this.disableUpload  = true;
            }
        }
       onCancelClick() {
          this.dialogRef.close();
       }
  }
  
  &lt;mat-form-field class="full-width"&gt;
      &lt;textarea [(ngModel)]="data.attachment.note" [disabled]="!fileToUpload &amp;&amp; !disableUpload" matInput matTextareaAutosize matAutosizeMinRows="1" matAutosizeMaxRows="3" placeholder="Note"&gt;
      &lt;/textarea&gt;
  &lt;/mat-form-field&gt;
  
  &lt;button fxFlex="nogrow" mat-button (click)="onCancelClick()"&gt;Cancel&lt;/button&gt;
  &lt;button *ngIf="disableUpload" fxFlex="nogrow" mat-button cdkFocusInitial (click)="updateAttachmentNote()"&gt;
      Update
  &lt;/button&gt;
  </code></pre>
  
  <p>But here what I am seeing is when I edit data in the Dialog box, data is automatically updating in the table which I am able to see in the background.</p>
  
  <p>Can anyone help here?</p>