Skip to content

Commit

Permalink
fix(primeng): remove datepicker from main module
Browse files Browse the repository at this point in the history
fix #3339
BREAKING CHANGE: primeng `datepicker` type has been removed from `FormlyPrimeNGModule`, use `FormlyDatepickerModule` instead.

```ts
import { FormlyDatepickerModule } from '@ngx-formly/primeng/datepicker';

@NgModule({
  imports: [
      ...
      FormlyDatepickerModule,
  ],
})
export class AppModule {}
```
  • Loading branch information
aitboudad committed Jun 10, 2022
1 parent 7f02170 commit fb623be
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 12 deletions.
5 changes: 3 additions & 2 deletions demo/src/app/ui/ui-primeng/config.module.ts
Expand Up @@ -5,17 +5,18 @@ import { CommonModule, debugFields } from '../common';

import { AppComponent } from './app.component';
import { FormlyPrimeNGModule } from '@ngx-formly/primeng';
import { DatepickerExampleConfig } from './datepicker';
import { InputExampleConfig } from '../common/input';
import { CheckboxExampleConfig } from '../common/checkbox';
import { RadioExampleConfig } from '../common/radio';
import { TextareaExampleConfig } from '../common/textarea';
import { SelectExampleConfig } from './select';
import { DatepickerAppModule, DatepickerExampleConfig } from './datepicker';

@NgModule({
imports: [
CommonModule,
FormlyPrimeNGModule,
DatepickerAppModule,
RouterModule.forChild([
{
path: '',
Expand All @@ -31,8 +32,8 @@ import { SelectExampleConfig } from './select';
TextareaExampleConfig,
CheckboxExampleConfig,
RadioExampleConfig,
DatepickerExampleConfig,
SelectExampleConfig,
DatepickerExampleConfig,
],
},
},
Expand Down
5 changes: 2 additions & 3 deletions demo/src/app/ui/ui-primeng/datepicker/app.module.ts
Expand Up @@ -2,8 +2,7 @@ import { NgModule } from '@angular/core';
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 All @@ -15,7 +14,7 @@ import { AppComponent } from './app.component';
validationMessages: [{ name: 'required', message: 'This field is required' }],
}),

FormlyDatePickerModule,
FormlyDatepickerModule,
],
declarations: [AppComponent],
})
Expand Down
2 changes: 1 addition & 1 deletion src/ui/primeng/datepicker/src/datepicker.module.ts
Expand Up @@ -25,4 +25,4 @@ import { FormlyFieldDatepicker } from './datepicker.type';
}),
],
})
export class FormlyFieldDatepickerModule {}
export class FormlyDatepickerModule {}
8 changes: 4 additions & 4 deletions src/ui/primeng/datepicker/src/public_api.ts
@@ -1,7 +1,7 @@
import { FormlyFieldDatepickerModule } from './datepicker.module';
import { FormlyDatepickerModule } from './datepicker.module';
export { FormlyDatepickerFieldConfig } from './datepicker.type';

/** @deprecated use FormlyFieldDatepickerModule */
const FormlyDatePickerModule = FormlyFieldDatepickerModule;
/** @deprecated use FormlyDatepickerModule */
const FormlyDatePickerModule = FormlyDatepickerModule;

export { FormlyFieldDatepickerModule, FormlyDatePickerModule };
export { FormlyDatepickerModule, FormlyDatePickerModule };
2 changes: 0 additions & 2 deletions src/ui/primeng/src/lib/ui-primeng.module.ts
Expand Up @@ -5,7 +5,6 @@ import { FormlyTextAreaModule } from '@ngx-formly/primeng/textarea';
import { FormlyRadioModule } from '@ngx-formly/primeng/radio';
import { FormlyCheckboxModule } from '@ngx-formly/primeng/checkbox';
import { FormlySelectModule } from '@ngx-formly/primeng/select';
import { FormlyDatePickerModule } from '@ngx-formly/primeng/datepicker';

@NgModule({
imports: [
Expand All @@ -15,7 +14,6 @@ import { FormlyDatePickerModule } from '@ngx-formly/primeng/datepicker';
FormlyRadioModule,
FormlyCheckboxModule,
FormlySelectModule,
FormlyDatePickerModule,
],
})
export class FormlyPrimeNGModule {}

0 comments on commit fb623be

Please sign in to comment.