Skip to content

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'

T

SchemaPath<T>

The path to the field to check.

T

The value to compare against.

SchemaRule

A rule function that returns true if the value matches.

applyWhen(path.field, valueEquals(path.other, 'some-value'), required);