requiredTrimmed
requiredTrimmed(
path,option?):void
Defined in: projects/ngx-signal-schema/src/lib/validators/required-trimmed.ts:23
A validator for signal-based forms that checks if a string value is present after trimming whitespace. Returns a ‘required’ error if the value is null, undefined, or empty after trimming.
This is the standard “required” validator for text inputs and textareas.
Parameters
Section titled “Parameters”SchemaPath<string | null | undefined>
The schema path to the string field to be validated.
option?
Section titled “option?”Optional configuration for the validator.
Returns
Section titled “Returns”void
Example
Section titled “Example”requiredTrimmed(path.username);requiredDefined - Use this for non-string fields like booleans or numbers.