I have a text area on which I have applied max length directive of angular:
<textarea placeholder="Quote text here" ng-model="quote.text" ng-maxlength="400" name="text"></textarea>
Now I am also showing the word count by using angular ng-show
and ng-hide
directive:
<div class="row word-count">
<h5>Word count :</h5>
<h5 ng-show="quote.text.length > 0">{{quote.text.length}}</h5>
<h5 ng-hide="quote.text.length > 0" class="ng-hide">0</h5>
</div>
the problem is that as soon as word count exceeds the max-length directive the ng-show
and ng-hide
are automatically triggered as reversed. Is there someway to stop it ?