File

packages/components/eui-input-number/eui-number-control.directive.ts

Description

Directive for the EuiInputNumberComponent. This directive is used to handle the value changes of the input element and update the value of the directive and the form control. It also implements the ControlValueAccessor interface to allow the directive to be used with reactive forms.

With Reactive Forms

Example :
form = new FormGroup({
  price: new FormControl(0)
});
Example :
<input euiInputNumber formControlName="price" [fractionDigits]="2" />

Accessibility

  • Integrates with Angular Forms validation
  • Automatically handles disabled state

Notes

  • Automatically applied when using formControl, formControlName, or ngModel
  • Handles large number precision by returning strings when needed

Implements

ControlValueAccessor Validator OnInit

Metadata

Index

Methods

Methods

registerOnChange
registerOnChange(fn: any)
Parameters :
Name Type Optional
fn any No
Returns : void
registerOnTouched
registerOnTouched(fn: any)
Parameters :
Name Type Optional
fn any No
Returns : void
registerOnValidatorChange
registerOnValidatorChange(fn: () => void)
Parameters :
Name Type Optional
fn function No
Returns : void
setDisabledState
setDisabledState(isDisabled: boolean)

Set the disabled state of the input element.

Parameters :
Name Type Optional
isDisabled boolean No
Returns : void
validate
validate(control: AbstractControl)
Parameters :
Name Type Optional
control AbstractControl No
Returns : ValidationErrors | null
writeValue
writeValue(obj: any)
Parameters :
Name Type Optional
obj any No
Returns : void

results matching ""

    No results matching ""