如何验证我的数字输入字段仅接受整数而不接受任何类型的十进制数字(逗号/点)?
代码
Component
import { 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>
任何想法?