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">
- Implements
-
- ControlValueAccessor
- 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]", host: const {"(input)" : "onChange(\$event.target.value)", "(blur)" : "onTouched()"}, providers: const [DEFAULT_VALUE_ACCESSOR])
Constructors
- DefaultValueAccessor(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
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(
void fn(_)) → void -
Set the function to be called when the control receives a change event.
-
registerOnTouched(
void 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.