Spec-Zone.ru › Angular

disabled

Adds logic to a field to conditionally disable it. A disabled field does not contribute to the validation, touched/dirty, or other state of its parent field.

API

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

Adds logic to a field to conditionally disable it. A disabled field does not contribute to the validation, touched/dirty, or other state of its parent field.

@parampathSchemaPath<TValue, 1, TPathKind>

The target path to add the disabled logic to.

@paramconfig{ when?: string | NoInfer<LogicFn<TValue, string | boolean, TPathKind>> | undefined; } | undefined

Optional configuration object.

  • when: A reactive function that returns true (or a string reason) when the field is disabled, and false when it is not disabled. Can also be a static string reason.
@returnsvoid
function disabled<TValue, TPathKind = PathKind.Root>(path: SchemaPath<TValue, 1, TPathKind>, logic?: string | NoInfer<LogicFn<TValue, string | boolean, TPathKind>> | undefined): void;

Adds logic to a field to conditionally disable it.

@deprecated

Passing a function or string directly to disabled is deprecated. Use { when: ... } instead.

@parampathSchemaPath<TValue, 1, TPathKind>
@paramlogicstring | NoInfer<LogicFn<TValue, string | boolean, TPathKind>> | undefined
@returnsvoid

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/disabled

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API