Answer the question
In order to leave comments, you need to log in
AngularJS - Why doesn't initialized field pass validator?
Hello. As a result of populating fields with an asynchronous request of form fields, several fields return a required error on submit (fields are filled with the correct data)
Form field (using mdp-datepicker with Material Design interface)
<mdp-date-picker mdp-placeholder="Date *" mdp-format="dd, MMM DD, YYYY" mdp-open-on-click required
name="Date"
ng-model="vm.models.date">
</mdp-date-picker>
<div ng-messages="vm.editForm.Date.$error" ng-if='vm.editForm.Date.$dirty'>
<div ng-message="required" style="color:red">Date is required</div>
</div>
if(!vm.editForm.$valid){
//код обработки формы
}
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