NumberValueAccessor class

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

Example

<input type="number" (ngModel)="age">

Implemented types
Annotations
  • @Directive(selector: 'input[type=number][ngControl],' 'input[type=number][ngFormControl],' 'input[type=number][ngModel]', providers: [NUMBER_VALUE_ACCESSOR])

Constructors

NumberValueAccessor(HtmlElement element)

Properties

hashCode int
The hash code for this object.
no setterinherited
onChange ChangeFunction<double?>
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<double?> 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