ApplyOptionalOptions
Defined in: projects/ngx-signal-schema/src/lib/structure/optional-block.ts:136
Options for applying rules or schemas to an OptionalBlock.
Type Parameters
Section titled “Type Parameters”T
The type of the data inside the block.
K
The type of the enabled property in meta.
Properties
Section titled “Properties”isEnabled?
Section titled “isEnabled?”
optionalisEnabled?: (enabled) =>boolean
Defined in: projects/ngx-signal-schema/src/lib/structure/optional-block.ts:152
A function to determine if the block is enabled based on the meta.enabled value.
Supports complex logic when K is not just a boolean.
Parameters
Section titled “Parameters”enabled
Section titled “enabled”K
The value of meta.enabled.
Returns
Section titled “Returns”boolean
True if the block should be treated as enabled.
otherwise?
Section titled “otherwise?”
optionalotherwise?:SchemaOrSchemaFn<T>
Defined in: projects/ngx-signal-schema/src/lib/structure/optional-block.ts:144
Inline rules or schema applied to the data node when the block is considered disabled.
then:
SchemaOrSchemaFn<T>
Defined in: projects/ngx-signal-schema/src/lib/structure/optional-block.ts:140
Inline rules or schema applied to the data node when the block is considered enabled.