I have created a function that decides on a comment based on the result number added to an array and displays it in a table.
However, calling this function within the template is causing a performance slowdown. Is there a way to achieve the same outcome without directly calling the comment()
function in the HTML code?
Here is the StackBlitz project
To use the dropdown, simply click inside the input field and type either "F" for Fahrenheit or "C" for Celsius.
The process involves saving the results to the Local Storage and adding new results to an array (history of calculations).
Even though I dislike calling this function directly in the HTML, I am struggling to find an alternative implementation within the component itself.
<td>{{ comment(history.result, history.temperatureUnit === 'C') }}</td>