• Overview
@angular/forms/signals

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

API

function maxLength<  TValue extends ValueWithLengthOrSize,  TPathKind extends PathKind = PathKind.Root,>(  path: SchemaPath<TValue, 1, TPathKind>,  maxLength: number | LogicFn<TValue, number | undefined, TPathKind>,  config?: BaseValidatorConfig<TValue, TPathKind> | undefined,): void;
Jump to details