title: How to create two way binding in Angular dynamic data table?
body: <p>I used dynamic data table as below:</p>
  
  <pre><code>&lt;table class="table table-striped table-hover" mat-table matSort (matSortChange)="sortData($event)" dir="rtl"
    [dataSource]="dataSource"&gt;
    &lt;ng-container *ngFor="let column of columns" matColumnDef="{{column.columnDef}}"&gt;
      &lt;div&gt;
        &lt;th mat-header-cell *matHeaderCellDef&gt; {{column.label}}&lt;/th&gt;
      &lt;/div&gt;
      &lt;td mat-cell *matCellDef="let row; let index = index" class="cells"&gt;
        &lt;mat-form-field&gt;
        &lt;input matInput [placeholder]="column.label" [value]="column.cell(row, column)"&gt;
      &lt;/mat-form-field&gt;
      &lt;/td&gt;
    &lt;/ng-container&gt;
    &lt;tr mat-header-row *matHeaderRowDef="displayedColumns"&gt;&lt;/tr&gt;
    &lt;tr (click)="showContent(row)" class="rows" mat-row *matRowDef="let row; columns: displayedColumns;"&gt;&lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>and this is my typescript code for build columns and data source:</p>
  
  <pre class="lang-js prettyprint-override"><code>let mhd = {
      columnDef: eachColumns['columnName'],
      label: eachColumns['displayName'],
      cell: (row, c) =&gt; {
          return row[c.columnDef];
      }
  };
  this.columns.push(mhd)
  
  this.displayedColumns = this.columns.map(c =&gt; c.columnDef);
  this.dataSource = new MatTableDataSource(this.result);
  </code></pre>
  
  <p>I change data of input 
  then console.log(this.result)
  but in console i see Previous object.</p>
  
  <p>if i change to <code>[(value)]="column.cell(row, column)"</code>
  I get this error below in console:</p>
  
  <blockquote>
    <p>core.js:14597 ERROR Error: Uncaught (in promise): Error: Template parse errors:
    Parser Error: Unexpected token '=' at column 25 in [column.cell(row, column)=$event] in ng:///ReportModule/MainGridReportComponent.html@14:51 ("= index" class="cells">
          
          ][(value)]="column.cell(row, column)">
        
        
    "): ng:///ReportModule/MainGridReportComponent.html@14:51</p>
  </blockquote>