Open Catscratch opened 8 months ago
We haven't really reworked the date adapters for standalone yet, but you can get it to work like this: https://stackblitz.com/edit/stackblitz-starters-cokrru?file=src%2Fdialog%2Fdialog.component.ts
Thanks for your reply. That's at least a workaround. We solved it (for now) by importing the MatDateFnsModule in the main.ts which will make it available for the whole application, but of course, it's not really standalone anymore.
But it will work, at least until the data adapters are updated to work with standalone components.
Is this a regression?
The previous version in which this bug was not present was
No response
Description
I'm not sure if it is a bug or just how it works atm, but when using a MatDatepicker with MatDateFnsModule it will not find the DateAdapter when using this in a standalone dialog component. (it's working in all other standalone components which are not a dialog).
If I add the MatDateFnsAdapter to the imports of the component which opens the dialog, everything is fine. But with standalone components I usually expect the imports in the component that really needs it.
I prepared a StackBlitz example.
Reproduction
StackBlitz link: https://stackblitz.com/edit/stackblitz-starters-35ebyd?file=src%2Fmain.ts Steps to reproduce:
Expected Behavior
No error message should appear on the console and the datepicker should open.
Actual Behavior
Datepicker does not open because of the console error.
Environment