Spec-Zone.ru › Angular

applyWhenValue

Условно применяет предварительно определённую схему к заданному FieldPath.

API

function applyWhenValue<TValue, TNarrowed extends TValue>(
  path: SchemaPath<TValue>,
  predicate: (value: TValue) => value is TNarrowed,
  schema: SchemaOrSchemaFn<TNarrowed>,
): void;
function applyWhenValue<TValue>(
  path: SchemaPath<TValue>,
  predicate: (value: TValue) => boolean,
  schema: NoInfer<SchemaOrSchemaFn<TValue>>,
): void;
function applyWhenValue<TValue, TNarrowed>(path: SchemaPath<TValue>, predicate: (value: TValue) => value is TNarrowed, schema: SchemaOrSchemaFn<TNarrowed>): void;

Условно применяет предварительно определённую схему к заданному FieldPath.

@parampathSchemaPath<TValue>

Целевой путь, к которому нужно применить схему.

@parampredicate(value: TValue) => value is TNarrowed

Проверка типа, которая принимает значение T и возвращает true, если T имеет тип TNarrowed.

@paramschemaSchemaOrSchemaFn<TNarrowed>

Схема, применяемая к полю, когда predicate возвращает true.

@returnsvoid
function applyWhenValue<TValue>(path: SchemaPath<TValue>, predicate: (value: TValue) => boolean, schema: NoInfer<SchemaOrSchemaFn<TValue>>): void;

Условно применяет предварительно определённую схему к заданному FieldPath.

@parampathSchemaPath<TValue>

Целевой путь, к которому нужно применить схему.

@parampredicate(value: TValue) => boolean

Функция, которая принимает значение T и возвращает true, если нужно применить схему.

@paramschemaNoInfer<SchemaOrSchemaFn<TValue>>

Схема, применяемая к полю, когда predicate возвращает true.

@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/applyWhenValue

Spec-Zone.ru

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