How to make ngMessage for required fields only show when dirty or submitting a form?

前端 未结 12 2570
一个人的身影
一个人的身影 2020-12-08 02:31

I\'m using AngularJS 1.3.0 RC0 and angular-messages. ng-messages dutifully shows error messages for those \"required\" fields when a form is initially loaded and pristine. S

12条回答
  •  北海茫月
    2020-12-08 02:52

    Use the ng-if attribute to check for $dirty on the tag that has ng-messages.

    Example :

    Required field

提交回复
热议问题