Reputation: 11
I need to know which div is selected. Check my code:
<divdsadsadasda
toggle(i) {
console.log(i) // i got index
}
I need to know which div is selected and return values from clicked item.
Upvotes: 0
Views: 143
Reputation: 8269
Instead of (click)="toggle(i)"
replace it with (click)="toggle(training)"
tht way you'll know which of the trainingExercises was selected.
<div *ngFor="let training of data.trainingExercises; let i = index;">
...
<div (click)="toggle(training)">
...
</div>
</div>
Upvotes: 1