2016-08-24 35 views
-1

刪除默認error messageangular形式提交刪除默認的錯誤信息提交

<input name="cardrouting" ng-change="cl(rn, 9)" ng-model-options="{ updateOn: 'default' , allowInvalid:'true'}" ng-model="rn" type="text" pattern="[0-9]*" class="form-control" required /> 
<span class="error-message" ng-show="form.cardrouting.$invalid && form.$submitted && form.cardrouting.$error.required">Please enter a number</span> 

當我提交點擊它總是顯示下面的錯誤消息,而不是「請輸入數字」

enter image description here

回答

-1

添加novalidate屬性form元素。

請參閱here