I currently have an Angular component being replaced for each instance of an array:
<app-doc-item
*ngFor="let docFeatureEl of docFeatures; let i = index";
[documentFeature]="docFeatureEl"
></app-doc-item
>
I would like to access the index each index (i) and print that value from within the component:
My child component looks as follows:
<a href="#" class="list-item" (click)="onSelected()">
<div class="pull-left">
<h4 class="list-group-item-heading">{{ docFeature?.string }}</h4>
</div>
</a>
ideally, the goal is to pass that index as a parameter for the onSelected() to perform actions on that particular instance,
unfortunately whenever I try to access i Angular tells me property 'i' does not exist on type
How do I access this index produced from within the component?
Cheers!