I have following angular:
<div class="test" *ngFor="let item of data; let i = index">
{{item}}
</div>
<div class="function_div" (click)="test(i);">Test Button </div>
then in .ts
,
export class test{
test(){
console.log(i);
}
}
I want to get a variable with the current index number.
How would I go about so that I can get the current index?
Thanks