I'm trying to do an Angular Material Table with Form Array, but I'm getting the error:
Could not find column with id "position".
I saw a lot of answers about the directive matColumnDef, but I have this at my code. Like this one and the name is the same with the dataSource. Like this one
<ng-container matColumnDef="position">
<th mat-header-cell *matHeaderCellDef> No. </th>
<td mat-cell *matCellDef="let element" [formControlName]='arrayOfProperties[0]' > {{element.position}} </td>
</ng-container>
You can see my code here: https://stackblitz.com/edit/angular-tyu1y4?file=src/main.ts
you can find the error at the browser console
I think it'something about the way that I am building the table here:
<div formArrayName="tourTable" *ngFor="let controls of tourTable.controls; let i = index;">
<div [formGroupName]="i">