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