You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use the @ngx-validate/core package for managing the validation messages of reactive forms automatically.
The NgxValidateCore module is imported to ThemeBasic but there is a problem here. We'll fix it to be able to override the default messages.
After this fix, you can define your own validation configuration in app.module.ts. If you like to override the configuration, you can import the NgxValidateCoreModule as like below:
// app.module.ts
@NgModule({imports: [// other importsThemeBasicModule.forRoot(),// If you are a member of commercial, this should be ThemeLeptonModule.forRoot() instead.// make sure that the NgxValidateCoreModule is under the ThemeBasicModule// the configurations in ThemeBasicModule are as followsNgxValidateCoreModule.forRoot({targetSelector: '.form-group',blueprints: {creditCard: 'AbpValidation::ThisFieldIsNotAValidCreditCardNumber.',email: 'AbpValidation::ThisFieldIsNotAValidEmailAddress.',invalid: 'AbpValidation::ThisFieldIsNotValid.',max: 'AbpValidation::ThisFieldMustBeBetween{0}And{1}[{{ min }},{{ max }}]',maxlength:
'AbpValidation::ThisFieldMustBeAStringOrArrayTypeWithAMaximumLengthOf{0}[{{ requiredLength }}]',min: 'AbpValidation::ThisFieldMustBeBetween{0}And{1}[{{ min }},{{ max }}]',minlength:
'AbpValidation::ThisFieldMustBeAStringOrArrayTypeWithAMinimumLengthOf{0}[{{ requiredLength }}]',ngbDate: 'AbpValidation::ThisFieldIsNotValid.',passwordMismatch: 'AbpIdentity::Identity.PasswordConfirmationFailed',range: 'AbpValidation::ThisFieldMustBeBetween{0}And{1}[{{ min }},{{ max }}]',required: 'AbpValidation::ThisFieldIsRequired.',url: 'AbpValidation::ThisFieldIsNotAValidFullyQualifiedHttpHttpsOrFtpUrl',},errorTemplate: ValidationErrorComponent,}),],// ...})exportclassAppModule{}
The text was updated successfully, but these errors were encountered:
mehmet-erim
changed the title
The validation messages of @ngx-validate/core cannot be overridden
The configuration of @ngx-validate/core cannot be overridden
Jul 23, 2020
We use the @ngx-validate/core package for managing the validation messages of reactive forms automatically.
The
NgxValidateCore
module is imported toThemeBasic
but there is a problem here. We'll fix it to be able to override the default messages.After this fix, you can define your own validation configuration in
app.module.ts
. If you like to override the configuration, you can import theNgxValidateCoreModule
as like below:The text was updated successfully, but these errors were encountered: