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.
@parampredicate
(value: TValue) => value is TNarrowedПроверка типа, которая принимает значение T и возвращает true, если T имеет тип TNarrowed.
@returns
void
function applyWhenValue<TValue>(path: SchemaPath<TValue>, predicate: (value: TValue) => boolean, schema: NoInfer<SchemaOrSchemaFn<TValue>>): void;
Условно применяет предварительно определённую схему к заданному FieldPath.
@parampredicate
(value: TValue) => booleanФункция, которая принимает значение T и возвращает true, если нужно применить схему.
@paramschema
NoInfer<SchemaOrSchemaFn<TValue>>Схема, применяемая к полю, когда predicate возвращает true.
@returns
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/applyWhenValue