<span class="fl"> <input type="text" style="width:340px;" class="f_input" name="t_store" value="" required ng-model="t_store" store-info-verify> </span> <span class="error" ng-messages="myForm.t_store.$error" ng-message-multiple> <span ng-message="required"><b></b>請填寫名稱</span> <span ng-message="checkLength"><b></b>不能大于10個字符</span> </span>現在的問題是只要打開頁面就會提示請填寫名稱,而不是失去焦點后提示.不知道該如何隱藏,我試著在錯誤標簽span上加入ng-show="myForm.t_store.$error.required"不起作用,我現在想開始不顯示錯誤,在它實際交互后再判斷.
angularjs required結合ng-message默認就會顯示自定義的錯誤
MMTTMM
2018-08-10 14:14:29