ngx-datetime-range-picker icon indicating copy to clipboard operation
ngx-datetime-range-picker copied to clipboard

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

Open WizMik opened this issue 4 years ago • 3 comments

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) ?

WizMik avatar Oct 20 '20 13:10 WizMik

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.

BhavinPatel04 avatar Oct 21 '20 22:10 BhavinPatel04

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

CallMeGary avatar Feb 01 '21 14:02 CallMeGary

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?

ot-repo avatar Jan 11 '22 11:01 ot-repo