DefaultValueAccessor class

The default accessor for writing a value and listening to changes that is used by the NgModel, NgFormControl, and NgControlName directives.

Example

<input type="text" ngControl="searchQuery">
Implemented types
Annotations
  • @Directive(selector: 'input:not([type=checkbox])[ngControl],' 'textarea[ngControl],' 'input:not([type=checkbox])[ngFormControl],' 'textarea[ngFormControl],' 'input:not([type=checkbox])[ngModel],' 'textarea[ngModel],[ngDefaultControl]', providers: [defaultValueAccessor])

Constructors

DefaultValueAccessor(HtmlElement _element)

Properties

hashCode int
The hash code for this object.
no setterinherited
onChange ChangeFunction<String>
getter/setter pairinherited
onTouched TouchFunction
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

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<String> 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(dynamic value) → void
Write a new value to the element.
override

Operators

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