Below is my stackblitz example where it shown all companies and their respective contacts. Iterating through each company and binding contacts to mat-table. So far it is working.
https://stackblitz.com/edit/angular-riepzk-2k5mcv?file=app%2Ftable-basic-example.html
But I need to add a new row to mat-table for their respective company. I have implemented logic to push the new contact to existing Form Array collection in addRow method. but it is not effecting on mat-table, but I able to see the updated contact in 'form.value'.
Here i have couple of questions
Since I am using formarray and binding each collection to mat-table, is this the right way of implementing the code when comparing with normal way of binding single dataSource to mat-table?
When binding single data source to mat-table, we used to initialize data source like dataSource = new MatTableDataSource() and then bind data to dataSource.data property in type script file and In .html page we update datasource to [dataSource] property of mat-table like mat-table [dataSource] = "datasource". But how it was the case of looping through the form array and binding data to [dataSource] property in html. Since the data is dynamic and we can not intialize the dataSource to MatTableDataSource directly in .ts file. (OR) please let me know if there is a way of implementation