DefaultValueAccessor
directive
The default ControlValueAccessor for writing a value and listening to changes on input
elements. The accessor is used by the FormControlDirective, FormControlName, and
NgModel directives.
API
Description
Usage Notes
class DefaultValueAccessor extends BaseControlValueAccessor implements ControlValueAccessor {}
writeValue
voidSets the "value" property on the input element.
@paramvalue
any@returns
voidonChange
(_: any) => voidThe registered callback function called when a change or input event occurs on the input element.
onTouched
() => voidThe registered callback function called when a blur event occurs on the input element.
setProperty
voidHelper method that sets a property on a target element using the current Renderer implementation.
@paramkey
string@paramvalue
any@returns
voidregisterOnTouched
voidRegisters a function called when the control is touched.
@paramfn
() => void@returns
voidregisterOnChange
voidRegisters a function called when the control value changes.
@paramfn
(_: any) => {}@returns
voidsetDisabledState
voidSets the "disabled" property on the range input element.
@paramisDisabled
boolean@returns
voidJump to details