I have the next code in the html:
<div *ngFor="let obj of objts; let i = index" class="col-md-3">
{{obj.name}}
</div>
And in my component I have the next:
catchName( petition ) {
console.log( petition );
}
I have tryied the next thing:
<div *ngFor="let obj of objts; let i = index" class="col-md-3">
{{obj.name}}
<div (click)="catchName(obj.name)"></div>
</div>
but doesn't works
how could I catch the value in a function of the name/variable in everyloop of NgFor?
Thank you very much