consider following code snippet where I subscribe an Observable using async pipe in a components template:
<table>
<tr *ngFor="let s of data | async">
<td>some informations</td>
<button (click)="setObject(s)">Save Object s in components variable</button>
</tr>
</table>
My question is if there is a way to store the object retrieved from *ngFor in a components local variable? I know there is a way to store it in a templates variable, but I want to save it in a components variable.
So for example, if I click a button, a components setter method is called to store the object in a components variable of same type.
Many thanks in advance :)