• Overview
@angular/forms/signals

minLength

function

Binds a validator to the given path that requires the length of the value to be greater than or equal to the given minLength. This function can only be called on string or array paths. In addition to binding a validator, this function adds MIN_LENGTH property to the field.

API

function minLength<
  TValue extends ValueWithLengthOrSize,
  TPathKind extends PathKind = PathKind.Root,
>(
  path: FieldPath<TValue, TPathKind>,
  minLength: number | LogicFn<TValue, number | undefined, TPathKind>,
  config?: BaseValidatorConfig<TValue, TPathKind> | undefined,
): void;

minLength

void

Binds a validator to the given path that requires the length of the value to be greater than or equal to the given minLength. This function can only be called on string or array paths. In addition to binding a validator, this function adds MIN_LENGTH property to the field.

@parampathFieldPath<TValue, TPathKind>

Path of the field to validate

@paramminLengthnumber | LogicFn<TValue, number | undefined, TPathKind>

The minimum length, or a LogicFn that returns the minimum length.

@paramconfigBaseValidatorConfig<TValue, TPathKind> | undefined

Optional, allows providing any of the following options:

@returnsvoid
Jump to details