如何驗證我的數(shù)字輸入字段只接受整數(shù)而不接受任何類型的小數(shù)(逗號/點)?代碼Componentimport { FormGroup, FormBuilder, Validators } from '@angular/forms';this.savingData = this.formBuilder.group({ amount: ['', Validators.required], // only accept integer 123000});HTML<ion-input type="number" min="1" inputmode="numeric" formControlName="amount" placeholder="{{ 'SAVINGS.amount' | translate }}" ></ion-input>任何想法?
角度/形式整數(shù)驗證器
縹緲止盈
2023-03-10 15:37:56