How can I validate my numeric input field to only accept integer and not any kind of decimal numbers (comma / dot)?
Code
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>
Any idea?