Answer the question
In order to leave comments, you need to log in
How to add ngRequired, ngMinlength, ngMaxlength etc. in $validators dynamically?
You need to dynamically add a validator to the input (not custom, but ngRequired, ngMinlength, ngMaxlength, etc.).
<input type="text" id="firstName" name="firstName" class="form-control" required="" ng-minlength="4" ng-maxlength="20" placeholder="First name" ng-model="firstname"/>
NgModelController.addValidator('ngRequired')
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question