In my application storing the duration value in minutes in back end and displaying the data in front end if duration value is below 1 hour in minutes and the same value is equal to above 1 hour in hours.
<strong *ngIf="event.eventDuration > 0 && event.eventDuration/60 < 1">{{event.eventDuration}} Minutes<br/></strong>
<strong *ngIf="event.eventDuration > 0 && event.eventDuration/60 >= 1">{{event.eventDuration/60}} Hour(s)<br/></strong>
Is this best way or write component function and return the value from the function? also component functions are calling too many times if we call from element attribute.