class ternary operator in angular html code example Example: ternary operator in angular <span> {{selectedSport.key === 'walking' ? 'steps' : 'km'}} </span>