valueIn
valueIn<
T>(path,values):SchemaRule
Defined in: projects/ngx-signal-schema/src/lib/conditions/value-in.ts:23
Checks if a field’s value is contained within a list of expected values. If you need the other way round, use includes
valueIn is a semantic shortcut for:
(ctx) => ctx.valueOf(path.someField) in ['val1', 'val2']Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”SchemaPath<T>
The path to the field to check.
values
Section titled “values”readonly T[] | (() => readonly T[])
The array of values to compare against, or a function returning them.
Returns
Section titled “Returns”A rule function that returns true if the value is in the set.
Example
Section titled “Example”applyWhen(path.field, valueIn(path.other, ['val1', 'val2']), required);