I have to display a table and call a function for every row of table and the function called once for a row.
-
You can add a directive
@Directive({ selector: '[invoke]'})
class InvokeDirective {
@Output() invoke:EventEmitter = new EventEmitter();
ngAfterContentInit() {
this.invoke.emit(null);
}
}
And the use it like
<tr *ngFor="let item of mf.data" (invoke)="myFunction(item)" >
讨论(0)
- 热议问题