I am attempting to dynamically change the font color in an input field based on the value entered into that field. However, I have encountered an issue with using ng-style as it is not recognizing the value of the scope and therefore the color does not update.
Here is the code snippet I utilized:
<input disabled name="saldo" type="text" class="form-control" placeholder="0.00" ng-model="saldo" ng-style="{'color': {{saldo}} < 0.00 ? 'red' : 'green') }">
This error message is what I am receiving:
Error: [$parse:syntax] Syntax Error: Token '<' not a primary expression at column 12 of the expression [{'color': < 0.00 ? 'red' : 'green') }] starting at [< 0.00 ? 'red' : 'green') }].
So my question is, how can I successfully access and utilize the 'saldo' value within the ng-style? (placing {{saldo}} outside the ng-style displays the correct value)