projects/aoc-client/ui/form/aoc-ui-input-text/aoc-ui-value-as-number.directive.ts
Inspiration from https://github.com/changhuixu/ngx-digit-only/blob/main/projects/uiowa/digit-only/src/lib/digit-only.directive.ts
ControlValueAccessor
Validator
Providers |
{
provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => AocUiValueAsNumberDirective), multi: true
}
{
provide: NG_VALIDATORS, useExisting: forwardRef(() => AocUiValueAsNumberDirective), multi: true
}
|
Selector | [aocUiValueAsNumber] |
Standalone | true |
Properties |
Methods |
HostListeners |
constructor(el: ElementRef)
|
||||||
Parameters :
|
blur |
Arguments : '$event'
|
input |
Arguments : '$event'
|
input | ||||||
input(_: InputEvent)
|
||||||
Decorators :
@HostListener('input', ['$event'])
|
||||||
Parameters :
Returns :
void
|
onBlur |
onBlur()
|
Decorators :
@HostListener('blur', ['$event'])
|
Returns :
void
|
registerOnChange | ||||||
registerOnChange(fn: any)
|
||||||
Parameters :
Returns :
void
|
registerOnTouched | ||||||
registerOnTouched(fn: any)
|
||||||
Parameters :
Returns :
void
|
setDisabledState | ||||||
setDisabledState(isDisabled: boolean)
|
||||||
Parameters :
Returns :
void
|
validate | ||||||
validate(control: AbstractControl)
|
||||||
Parameters :
Returns :
ValidationErrors | null
|
writeValue | ||||||
writeValue(obj: any)
|
||||||
Parameters :
Returns :
void
|
Public el |
Type : ElementRef
|
onChange |
Type : function
|
Default value : () => {...}
|
onTouched |
Type : function
|
Default value : () => {...}
|