provideFormValidationErrorMapper Type documentation¶
TypeScript declaration¶
import { provideFormValidationErrorMapper } from '@siemens/element-ng/form';The error mapper is used to resolve an angular validation error to a TranslatableString. It will be merged with already existing error mappers.
provideFormValidationErrorMapper(mapper: SiFormValidationErrorMapper): Provider
The error mapper is used to resolve an angular validation error to a TranslatableString. It will be merged with already existing error mappers.
Types Documentation¶
import type { SiFormValidationErrorMapper } from '@siemens/element-ng/form';Interface for form error mapper. It resolves a key to either a translatable string or function which is called with the validation error for its key and should return a translatable string.
-
dateFormat?:
TranslatableString | ((error: { format: string; }) => TranslatableString)¶ -
email?:
TranslatableString | ((error: { email: boolean; }) => TranslatableString)¶ -
max?:
TranslatableString | ((error: { max: number; actual: number; }) => TranslatableString)¶ -
maxDate?:
TranslatableString | ((error: { max: Date; actual: Date; }) => TranslatableString)¶ -
maxLength?:
TranslatableString | ((error: { requiredLength: number; actualLength: number; }) => TranslatableString)¶ -
min?:
TranslatableString | ((error: { min: number; actual: number; }) => TranslatableString)¶ -
minDate?:
TranslatableString | ((error: { min: Date; actual: Date; }) => TranslatableString)¶ -
minLength?:
TranslatableString | ((error: { requiredLength: number; actualLength: number; }) => TranslatableString)¶ -
numberFormat?:
TranslatableString | ((error: { numberFormat: boolean; }) => TranslatableString)¶ -
pattern?:
TranslatableString | ((error: { pattern: string | RegExp; }) => TranslatableString)¶ -
required?:
TranslatableString | ((error: { required: boolean; }) => TranslatableString)¶ -
requiredTrue?:
TranslatableString | ((error: { required: boolean; }) => TranslatableString)¶
import type { TranslatableString } from '@siemens/element-translate-ng/translate-types';Represents a translatable string. This can either be a translation key, e.g. ACTIONS.EDIT that will be automatically translated when displayed on the UI or a pre-translated string, e.g. Edit. Equivalent to a normal string in usage and functionality.
Except where otherwise noted, content on this site is licensed under MIT License.