BaseSingleLineInputComponent constructor

BaseSingleLineInputComponent(
  1. String? type,
  2. String? multiple,
  3. NgControl? cd,
  4. ChangeDetectorRef _changeDetector,
  5. DeferredValidator validator,
)

Implementation

BaseSingleLineInputComponent(String? type, String? multiple, NgControl? cd,
    this._changeDetector, DeferredValidator validator)
    : super(cd, _changeDetector, validator) {
  if (type == null) {
    this.type = 'text';
  } else if (const ['number', 'tel'].contains(type)) {
    // For number and telephone, the browser-default validation has to be
    // locale-aware and/or format-aware. Using 'text' here, so that we
    // don't use (broken) browser-default validation. Users can still
    // provide custom validation for these.
    this.type = 'text';
  } else {
    this.type = type;
  }
  this.multiple = attributeToBool(multiple);
}