Is there a way to call a method for each iteration of *ngFor and pass the iterated variable as a parameter?
For example:
<li *ngFor="let element of componentModel | keys">{{element.key}}--{{element.value}}</li>
Then, in the component, I have this method:
loadProperty(element:any){
console.log(element.key);
console.log(element.value);
}
I would like this function to be called for each iteration and receive the value of the iterated variable as a parameter. Any suggestions?