Conditional expression requires all 3 expressions at the end
This applies to a different context, but if you are using a pipe ( | ) in Angular and you get this error from your view you may need to put parentheses around your pipe like this:
<input value={{device.id ? (device.id | decimalToHex) : ''}}>
if you leave them off like this:
<input value={{device.id ? device.id | decimalToHex : ''}}>
Then you get this error
You need also to pass the result of the case in which condition will return false
. In other words you need to pass correct ternary operator
Something like if/else
. If true
return red
, else return blue
.
(selectedObject === f) ? 'red' : 'blue'