function gets called several times
问题 I want to display a dataList. Some values are calculate from a function. It seems angular2 calls the calculate function many times. <tr *ngFor="let data of dataList"> <td>{{ data.no }}</td> <td>{{ data.name }}</td> <td>{{ calculateFunction(data.price) }}</td> </tr> Console will output "calculate..." many times, more than dataList.length. calculateFunction() { console.log('calculate...'); return ...; } Should I worry about that for performance or just let angular2 do this? 回答1: The