W3cubDocs

/Angular

required

Binds a validator to the given path that requires the value to be non-empty. This function can only be called on any type of path. In addition to binding a validator, this function adds REQUIRED property to the field.

API

function required<TValue, TPathKind extends PathKind = PathKind.Root>(
  path: SchemaPath<TValue, 1, TPathKind>,
  config?:
    | (BaseValidatorConfig<TValue, TPathKind> & {
        when?: NoInfer<LogicFn<TValue, boolean, TPathKind>> | undefined;
      })
    | undefined,
): void;

Super-powered by Google ©2010–2025.
Code licensed under an MIT-style License. Documentation licensed under CC BY 4.0.
https://angular.dev/api/forms/signals/required