Typescript issue: Type NgxMatDatetimePicker<any>' is not assignable to type 'MatDatepickerPanel<MatDatepickerControl<any>, any, any>
Hi !
I tried to use your datetime picker component (version 7.0.1) with Angular 13.0.2 and Angular Material 13.0.2 But when I build my project library, I've got this error in my terminal :
projects/test-lib/src/lib/datetime-setting/datetime-setting.component.html:34:37 - error TS2322: Type 'NgxMatDatetimePicker<any>' is not assignable to type 'MatDatepickerPanel<MatDatepickerControl<any>, any, any>'.
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
~~~
projects/test-lib/src/lib/datetime-setting/datetime-setting.component.ts:9:16
templateUrl: './datetime-setting.component.html',
Error occurs in the template of component DatetimeSettingComponent.
I have testing to use your component as the simple way as possible but I still have this error. And I have checking your code and I don't see where the issue could it be.
Does anyone else have this error?
Thanks a lot for your help !
I got the same error, a other issue suggested this answer:
<mat-datepicker-toggle matSuffix [for]="$any(picker)">
Thanks a lot @JesperHonders, it works well for me !
It's ok, but this is not a solution. (It's ugly to use $any() on every time.) Please fix the types!
I have the same problem. On the other hand I've never seen anything like $any(..) in many years of angular, ugly but nice to have.
Thank you, it's save me !!!
I'm seeing the same issue; using $any(...) helped, but please fix the types!