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

Implements
  • ControlValueAccessor
Annotations
  • Directive(selector: "select[ngControl],select[ngFormControl],select[ngModel]", host: const {"(change)" : "onChange(\$event.target.value)", "(blur)" : "onTouched()"}, providers: const [SELECT_VALUE_ACCESSOR])

Constructors

SelectControlValueAccessor(Renderer _renderer, ElementRef _elementRef)

Properties

hashCode → int

Get a hash code for this object.

read-only, inherited
onChange → dynamic

read / write
onTouched → dynamic

read / write
runtimeType → Type

A representation of the runtime type of the object.

read-only, inherited
value → dynamic

read / write

Operators

operator ==(other) → bool

The equality operator.

inherited

Methods

noSuchMethod(Invocation invocation) → dynamic

Invoked when a non-existent method or property is accessed.

inherited
registerOnChange(dynamic fn(value)) → void

Set the function to be called when the control receives a change event.

registerOnTouched(dynamic fn()) → void

Set the function to be called when the control receives a touch event.

toString() → String

Returns a string representation of this object.

inherited
writeValue(value) → void

Write a new value to the element.