html - Setting Minimum Value to a Substraction (AngularJS) -
i know how possible set minimum value of "0" substration (100 - message.length
). don't want negative values returned when minimum number of caracteres (100) verified (for instance: "number of caracteres left: -55"). thank you.
<tr> <td colspan="2" align="center"> <textarea rows="10" cols="50" name="message" ng-model="message"></textarea> </td> </tr> <tr> <td align="center">number of caracteres left: {{100 - message.length}} </td> </tr> <tr> <td align="center" colspan="2"> <button type="submit" class="btn btn-success" ng-disabled="(!message || message.length < 100)">send</button> </td> </tr>
you try {{100 - message.length>0?100 - message.length:0}}
Comments
Post a Comment