0
<mat-form-field>
<input matInput placeholder="Protokol Detayı" type="text" required="true" name="detail" id="detail"
#detail="ngModel" ngModel required>
</mat-form-field>
<mat-error *ngIf="detail.touched && detail.invalid">
<div *ngIf="detail.errors.required">Bu alanı boş geçemezsiniz.</div>
</mat-error>
私は入力が文字の代わりに番号を取得する場合、エラーを表示したいです。しかし、私はそれをすることができませんでした。私は入力のタイプを書いているのが正しいと思います。角度、文字列と数値の検証エラーが
「テキスト」入力タイプ – kriss
はいで数字を入力することは完全に正しいですが、誰かが番号を入力した場合どのような私はショーにしたいとするとエラーになります。 –
正規表現を使用してパターン属性 – Gautam