Angular 2: Calculate sum of an element in ngFor

前端 未结 2 646
走了就别回头了
走了就别回头了 2021-01-15 05:36

I am trying to calculate the total (sum of amounts) outside the ngFor.

HTML

 
2条回答
  •  梦毁少年i
    2021-01-15 06:26

    You can always bind to the function on your template by using the one-way bind {{ }}

    In your code if you wanted to call your function and bind it directly to your view you would do such:

提交回复
热议问题