valueEquals
valueEquals<
T>(path,expected):SchemaRule
Defined in: projects/ngx-signal-schema/src/lib/conditions/value-equals.ts:23
Checks if a field’s value equals a specific expected value.
Useful for conditional conditions (e.g., in when conditions).
valueEquals is a semantic shortcut for:
(ctx) => ctx.valueOf(path.someField) === 'active'Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”SchemaPath<T>
The path to the field to check.
expected
Section titled “expected”T
The value to compare against.
Returns
Section titled “Returns”A rule function that returns true if the value matches.
Example
Section titled “Example”applyWhen(path.field, valueEquals(path.other, 'some-value'), required);