I am attempting to send the value of a selected row from one component to another upon clicking a button. However, in this particular example, I'm unsure where to obtain the selected row values and how to pass them on button click. After that, routing needs to be implemented.
When using this.selection.selected
, the same object is returned multiple times. How can I prevent this behavior? My goal is to pass the value as shown below:
<button (click)='onSelect(row)'>select row </button>
onSelect(id){
this.selectedRowValue = id
//some logics
}
Can anyone provide guidance on how to successfully transfer the selected row value from one component to another?