I have an input field and a span set up like this:
<input type="password" name="account_password" placeholder="Enter your new password" autocomplete="off" ng-model="res.account.new_password" required="" ng-minlength="res.minlength" class="form-control" />
<span ng-show="(res.account.new_password).length == res.minlength" class="text-danger">Should be at least 6 characters long</span><br>
In my angular controller, I've defined a variable: vm.minlength = 6;
The ng-minlength directive is functioning as expected but I'm having trouble showing an error message for the user:
<span ng-show="(res.account.new_password).length == res.minlength" class="text-danger">Should be at least 6 characters long</span><br>
Unfortunately, the error message disappears after typing the first letter.
res
represents my controller (using vm
to declare variables in the angular controller). Any assistance would be greatly appreciated! Thank you for your time!
Changing from ==
to <
causes the span not to display at all!