misha130/ion-datepicker

Facing issues in Lazy Loading

Afarooq143 opened this issue · 4 comments

Hi it worked fine for me til i had to make changes in my App to implement Lazy Loading and i'm getting following errors please help me out

I'm calling datepicker modal from my Sign Up page to enter dob & on click i call function to display datepicker.

Error:
date err

DatePicker Calling Form
date err2

Code
Template:

Date of Birth
<ion-input [formControl]="signupForm.controls['date_of_birth']" [(ngModel)]="date_of_birth" (click)="showCalendar()" [ngClass]="{'error-border':!signupForm.controls['date_of_birth'].valid}">

Component

showCalendar() {
const dateSelected =
this.datePickerProvider.showCalendar(this.modalCtrl);
dateSelected.subscribe(date =>
this.date_of_birth = this.dateFormat.transform(date, 'MM/dd/yyyy')
);
}

Note: Remember it was working fine till i implemented Lazy Loading.

Please help

Try and add
IonicPageModule.forChild(DatePicker),
In your page module as a work around.
Tell me if it works.

Hi i am also getting problem with lazy loading. I already imported DatePickerModule in my PageModule.
In my case i am getting error as

Error: Uncaught (in promise): Error: No component factory found for ModalCmp. Did you add it to @NgModule.entryComponents?
Error: No component factory found for ModalCmp. Did you add it to @NgModule.entryComponents?

If i add DatePickerModule in my appModule it is working fine. But unable to work with lazyload.
Please Help

Tested today, works.
I made a branch that checks if it works:
https://github.com/misha130/ion-datepicker/tree/lazy

Thanks for your response.



I to done the same, it is working fine. But my problem is we imported DatePickerModule 2 times.
One in lazy.module.ts and in app.module.ts.
Can i make it work by adding only in lazy.module.ts (i.e by removing it from app.module.ts)

Because my splash screen is taking soo much time if we are adding more load on app.module