My custom table component requires a model for row selection actions that can be two-way bound in the following way:
<my-table [(selected)]="selectedRows"></my-table>
Alternatively, I have the option to pass an item through one-way data binding if I do not need to track changes made to that model:
<my-table [selected]="selectedRows"></my-table>
If I prefer not to bind the data item two-ways and instead want to pass it down via one-way data binding along with a handler/event emitter, the syntax would look something like this:
<my-table [selected]="selectedRows" (selected)="handleSelectedChanged($event)"></my-table>
Is it possible to achieve this functionality with minimal or no changes to the my-table
component? Or do I need to create an @Output
parameter on the my-table
component in order to utilize handleSelectedChanged($event)
?
Thank you!