I am stuck but pretty sure what I am doing is possible.
Scenario:
I have made a common-table.component.ts that contains a mat-table (Angular Material Table) to display data.
Now I need to add buttons(with events) to it from the parent in a very generic/dynamic way. The child-component will need to update attributes or parameters on button to make it specific to that row.
Scenario Example:
- A "Users" page with a table of users (where the table is a child component.)
- Now we want to add inline buttons to do custom actions like (edit/go-to-details/remove).
- As the rows render each button is customized for that row
Template-Html: <button type="button" (click)="removeUser( row.id )">Edit - Here is a quick example of the above
https://stackblitz.com/edit/angular-datatable-responsive-mhbdfn?file=src%2Fapp%2Fviews%2Fshared-table%2Fshared-table.component.html
Ideas so far involve passing in
CustomElement has a string html-template with events to match
or using the Renderer2-Element to change the DOM?
Renderer2 example.
https://stackblitz.com/edit/angular-gnyd4e?file=src%2Fapp%2Fapp.component.ts
or
the other way is to give ID's and in the parent use addEventListener()
But I am open for suggestions or thoughts of the best way to do this?

