CheckboxControlValueAccessor
A ControlValueAccessor for writing a value and listening to changes on a checkbox input
element.
API
class CheckboxControlValueAccessor extends BuiltInControlValueAccessor implements ControlValueAccessor {}
writeValue
voidSets the "checked" property on the input element.
anyvoidonChange
(_: 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.
stringanyvoidregisterOnTouched
voidRegisters a function called when the control is touched.
() => voidvoidregisterOnChange
voidRegisters a function called when the control value changes.
(_: any) => {}voidsetDisabledState
voidSets the "disabled" property on the range input element.
booleanvoidDescription
A ControlValueAccessor for writing a value and listening to changes on a checkbox input
element.
Exported by
Usage Notes
Using a checkbox with a reactive form.
The following example shows how to use a checkbox with a reactive form.
const rememberLoginControl = new FormControl();
<input type="checkbox" [formControl]="rememberLoginControl">

