angular.js - How to avoid hidden form elements from validation in angular?
PHP中文网2017-05-15 16:59:01
0
4
554
Like the title, I have a form, and then I use angular form verification, but some form controls are sometimes hidden, so how can I skip the verification of those hidden form controls when I submit?
Then just don’t add validation to the hidden form controls
After reading other answers, I realized that I thought it was this
<input type="hidden"/>
那你就用
ng-if
Remove hidden controls directly from the page when submitting.
If you don’t need the hidden form, you can use ng-if to remove it
Just replace ng-hide with ng-if