Q:

How to call a method in component for every iteration in *ngFor in angular2?

I want to call a method for every iteration of *ngFor and pass the iterated variable in the method.
for eg.
<li *ngFor="let element of componentModel | keys">{{element.key}}--{{element.value}}</li>

then I have this method in component as:
loadProperty(element:any){
   console.log(element.key);
   console.log(element.value);
}

I want this function to get called for every iteration and pass every value of iterated variable.
any inputs?

A:

Looking for this.
<li *ngFor="let element of componentModel | keys">
      {{element.key}}--{{element.value}}
      {{ loadProperty(element) }}
    </li>

