DEV Community

Discussion on: Angular - Avoid function calls in templates

Collapse
 
abdurrkhalid333 profile image
Abdur Rehman Khalid

This is a good implementation of the function calls in the templates but it depends upon the need of the function calls in the angular templates for example let's say that you are trying to calculate the total price for the items in the bucket so what you will do is to call the function in order to get the total price whenever the product is removed or added into the basket. So, it all depends upon the need and use case of the coding. But again as far as possible we should try not to use the function calls on the template.