• Overview
@angular/forms/signals

max

function

Binds a validator to the given path that requires the value to be less than or equal to the given maxValue. This function can only be called on number paths. In addition to binding a validator, this function adds MAX property to the field.

API

function max<TPathKind extends PathKind = PathKind.Root>(
  path: { [ɵɵTYPE]: [number, TPathKind] },
  maxValue: number | LogicFn<number, number | undefined, TPathKind>,
  config?: BaseValidatorConfig<number, TPathKind> | undefined,
): void;

max

void

Binds a validator to the given path that requires the value to be less than or equal to the given maxValue. This function can only be called on number paths. In addition to binding a validator, this function adds MAX property to the field.

@parampath{ [ɵɵTYPE]: [number, TPathKind]; }

Path of the field to validate

@parammaxValuenumber | LogicFn<number, number | undefined, TPathKind>

The maximum value, or a LogicFn that returns the maximum value.

@paramconfigBaseValidatorConfig<number, TPathKind> | undefined

Optional, allows providing any of the following options:

@returnsvoid
Jump to details