Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using ngx-datetime-range-picker in my custom library triggers ERR_NGX_DATETIME_RANGE_PICKER: NgxDatetimeRangePickerModule is already loaded #28

Open
WizMik opened this issue Oct 20, 2020 · 3 comments

Comments

@WizMik
Copy link

WizMik commented Oct 20, 2020

I've created a custom library to reuse components among several applications, and I want to use ngx-datetime-range-picker in one of my library modules. The problem is, when I import my library module into one of the main application's lazy loaded module, it triggers the following error : ERR_NGX_DATETIME_RANGE_PICKER: NgxDatetimeRangePickerModule is already loaded. Import it in the AppModule only.

Is there a way to correctly import ngx-datetime-range-picker in a reusable module without forRoot ? (maybe by implementing a forChild method) ?

@BhavinPatel04
Copy link
Owner

You can create a small wrapper module in application code-base (example: ngx-datetime-range-picker-wrapper.module) and then import it using ./ngx-datetime-range-picker-wrapper.module#NgxDatetimeRangePickerModule. I didn't get enough time to try this myself but please let me know if this works for you.

@CallMeGary
Copy link

I ran into the same issue. Can you please explain a bit on the proposed solution above? I don't understand it.

@ot-repo
Copy link

ot-repo commented Jan 11, 2022

Hello, I have the same problem and still found no solution. Could you please explain your proposal in detail, so that we can give it a try?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants