Validators.pattern Angular Number
new FormControl({value: field.value}, [Validators.required, Validators.pattern(/^-?(0|[1-9]\d*)?$/)])
Farhan Ali
new FormControl({value: field.value}, [Validators.required, Validators.pattern(/^-?(0|[1-9]\d*)?$/)])
<input matInput (input)="validateInput(field)" [placeholder]="field.label" type="number" [formControlName]="field.id" [id]="field.id">
validateInput(field) {
this.detailForm.patchValue({ [field.id]: this.detailForm.controls[field.id].value }); }
}