Reputation: 3039
Trying to dynamically add validation to input file if I choose first option from select. But if I add required
attribute, it still ng-valid
in class. If I load file to input file, it still ng-empty
.
What's wrong? http://plnkr.co/edit/pjyCULes60jWf7yqNsyB?p=preview
Upvotes: 0
Views: 362
Reputation: 587
The form validation in AngularJS depends on the ngModel
attribute, which doesn't work with input type=file
.
To solve this, either use ngFileUpload which helps you solve other problems you'll encounter with file upload in Angular as well, or see this or that answer.
Upvotes: 1