Skip to content

Commit

Permalink
fix(core): update validation messages signature (#3206)
Browse files Browse the repository at this point in the history
fix #3201
  • Loading branch information
aitboudad committed Feb 25, 2022
1 parent ad057c5 commit e6d309e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion demo/src/app/ui/ui-primeng/datepicker/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { CommonModule } from '@angular/common';
import { ReactiveFormsModule } from '@angular/forms';
import { FormlyModule } from '@ngx-formly/core';

import { FormlyDatePickerModule } from '@ngx-formly/primeng/datepicker/';
import { FormlyDatePickerModule } from '@ngx-formly/primeng/datepicker';

import { AppComponent } from './app.component';

Expand Down
16 changes: 11 additions & 5 deletions src/core/src/lib/models/fieldconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,12 @@ export interface FormlyFieldConfig {
* - `validation.show`: A boolean you as the developer can set to force displaying errors whatever the state of field. This is useful when you're trying to call the user's attention to some fields for some reason.
*/
validation?: {
messages?: {
/** @deprecated use minLength */
messages?: { [messageProperties: string]: ValidationMessageOption['message'] } & {
/** @deprecated use `minLength` */
minlength?: ValidationMessageOption['message'];
/** @deprecated use maxLength */
maxlength?: ValidationMessageOption['message'];

[messageProperties: string]: ValidationMessageOption['message'];
/** @deprecated use `maxLength` */
maxlength?: ValidationMessageOption['message'];
};
show?: boolean;
[additionalProperties: string]: any;
Expand Down Expand Up @@ -201,8 +200,15 @@ export interface FormlyTemplateOptions {
hidden?: boolean;
max?: number;
min?: number;

minLength?: number;
/** @deprecated use `minLength` */
minlength?: number;

maxLength?: number;
/** @deprecated use `minLength` */
maxlength?: number;

pattern?: string | RegExp;
required?: boolean;
tabindex?: number;
Expand Down

0 comments on commit e6d309e

Please sign in to comment.