When obtaining a response from the server in JSON format (containing color.mix and color.pure), it is passed directly to the template. In this template, I need to display a value if it exists or show another value if it does not.
<span ng-if="color.mix">{{color.mix}}</span>
If the value is not present, I want to display the 'pure' value. Initially, I attempted the following:
<span ng-if="!color.mix">{{color.pure}}</span>
<span ng-if="color.mix">{{color.mix}}</span>
However, when both values are received, both are displayed simultaneously.
What would be the correct approach to achieve this?
(Using Angular 1.6)