@elemental/ui / Class

LmnDynamicValidatorMessageDirective

A directive that used for display the error messages of a form control automatically. It use the LMN_VALIDATION_ERROR_MESSAGES token for get the error messages.

Properties

NameTypeDescription
customErrorMessages
r
InputSignal<LmnErrorMessages>

Custom error messages for the control.

disabled
r
InputSignalWithTransform<boolean, unknown>
errorsContainer
r
InputSignal<ViewContainerRef | undefined>

A ViewContainerRef for the error messages.

errorsCountToDisplay
r
InputSignalWithTransform<number, unknown>

The maximum number of error messages to display. Use -1 for display all errors. @default 3

errorStateMatcher
r
InputSignal<LmnErrorStateMatcher | LmnErrorStateMatchers>

A function that takes an AbstractControl and a FormGroupDirective or NgForm and returns a boolean or an Observable<boolean> or an object that for each error key has a function to determinate if show the specific error. @default onDirtyOrSubmittedErrorStateMatcher

negative
r
InputSignalWithTransform<boolean, unknown>

Use the same input name of control to be synchronized with it.

readonly
r
InputSignalWithTransform<boolean, unknown>

Use the same input name of control to be synchronized with it.

renderedErrors
r
Signal<Map<string, LmnDynamicError>>
validateOn
r
InputSignal<LmnValidateOnEvent>

The event to trigger the process for show/hide the error messages. @default 'blur'

Methods

setDefaultErrorContainer()

Assign the errorContainer only if not already assigned.

Presentation
setDefaultErrorContainer(container: ViewContainerRef): void;
Parameters
NameTypeDescription
container
ViewContainerRef
Returns
void