I tried using ngx-daterangepicker-material in an Angular 21 standalone component, and I keep getting the following error:
I tried using ngx-daterangepicker-material in an Angular 21 standalone component, and I keep getting the following error:
Steps I followed:
- Installed ngx-daterangepicker-material latest version.
- Imported NgxDaterangepickerMd in the standalone component imports array.
- Added LocaleService to providers.
- Used <input ngxDaterangepickerMd ...> in the template.
Expected behavior:
- The date range picker should work in Angular 21 standalone components.
Actual behavior:
- Angular throws a runtime error because the library relies on .forRoot() and NgModule-based DI which is incompatible with standalone components.
Environment:
- Angular: 21
- ngx-daterangepicker-material: latest
- Node:24.11.1
- Browser: Brave
- Additional context:This library currently does not support standalone components or Angular 21’s new DI system.
I tried using ngx-daterangepicker-material in an Angular 21 standalone component, and I keep getting the following error:
I tried using ngx-daterangepicker-material in an Angular 21 standalone component, and I keep getting the following error:Steps I followed:
Expected behavior:
Actual behavior:
Environment: