SelectControlValueAccessor class

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

Note: We have to listen to the 'change' event because 'input' events aren't fired for selects in Firefox and IE: https://bugzilla.mozilla.org/show_bug.cgi?id=1024350 https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/4660045

Implemented types
Annotations
  • @Directive(selector: 'select[ngControl],select[ngFormControl],select[ngModel]', providers: [SELECT_VALUE_ACCESSOR], visibility: Visibility.all)

Constructors

SelectControlValueAccessor(HtmlElement element)

Properties

hashCode int
The hash code for this object.
no setterinherited
onChange ChangeFunction
getter/setter pairinherited
onTouched TouchFunction
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value Object?
getter/setter pair

Methods

handleChange(String value) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onDisabledChanged(bool isDisabled) → void
This function is called when the control status changes to or from "DISABLED".
override
registerOnChange(ChangeFunction 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
A string representation of this object.
inherited
touchHandler() → void
inherited
writeValue(Object? value) → void
Write a new value to the element.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited