I have elements inside ngFor loop. Each elements get reference like this #f{{floor}}b. As you see floor is a variable.
I want to pass these elements to a function.
Code:
<button #f{{floor}}b (click)="onClick(f{{floor}}b)"></button>
I tried this but it only pass a string like this f5b not the element itself:
<button #f{{floor}}b (click)="onClick('f'+floor+'b')"></button>
Full code:
<div *ngFor="let floor of floors">
<button #f{{floor}}b (click)="onClick('f'+floor+'b')"></button>
</div>
floor is a number and floors is an array of numbers.