Reputation: 1634
I'm trying to create a table that looks like a spreadsheet with editable inputs inside each td
. I'm using Angular's ComponentFactoryResolver
as explained here, to add a row to the table when user clicks the add button.
Once the row is added, I use EventEmitter
to emit all the data of that row as the last column value is changed.
I've tried to re implement the same functionality on this StackBlitz.
I'm having the following issues:
Upvotes: 1
Views: 1201
Reputation: 2590
This is what I am suggesting. You can create a list of row objects in the parent (table) component and use *ngFor to loop it over.
<app-row
*ngFor="let row of rowList"
[row]="row"
(entryUpdate)="onEntryUpdated($event)">
</app-row>
Please have a look at this
Upvotes: 4