CheckboxControlValueAccessor class

The accessor for writing a value and listening to changes on a checkbox input element.

Example

<input type="checkbox" ngControl="rememberLogin">
Implemented types
Annotations
  • @Directive(selector: 'input[type=checkbox][ngControl],' 'input[type=checkbox][ngFormControl],' 'input[type=checkbox][ngModel]', providers: const [CHECKBOX_VALUE_ACCESSOR])

Constructors

CheckboxControlValueAccessor(HtmlElement element)

Properties

hashCode → int
The hash code for this object. [...]
read-only, inherited
onChange ChangeFunction<bool>
read / write, inherited
onTouched TouchFunction
read / write, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

handleChange(bool checked) → void
@HostListener('change', const ['\$event.target.checked'])
onDisabledChanged(bool isDisabled) → void
This function is called when the control status changes to or from "DISABLED". [...]
override
writeValue(bool value) → void
Write a new value to the element.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
registerOnChange(ChangeFunction<bool> fn) → void
Set the function to be called when the control receives a change event.
inherited
registerOnTouched(TouchFunction fn) → void
Set the function to be called when the control receives a touch event.
inherited
toString() → String
Returns a string representation of this object.
inherited
touchHandler() → void
@HostListener('blur'), inherited

Operators

operator ==(dynamic other) → bool
The equality operator. [...]
inherited