implementing a directive to exclude a hidden input element from validation ($addControl issue)

后端 未结 2 1807

I\'m creating a directive to exclude a hidden input element from validation: http://plnkr.co/edit/Vnwvq2AT7JpgTnoQwGh9?p=preview

app.directive(\'shownValidat         


        
2条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-19 05:08

    It seems you are hiding the element using ng-show and thus not submitting the input along with the form.

    In this case, we can use ng-if directive in the view in order to remove the element on the fly. This would remove the element and it's validity too.

提交回复
热议问题