Reputation: 33
I've a problem with datepicker and Angular2 Material.
When I tried to use this control, I get this error:
ERROR Error: "[object Object]"
I have the references done at app_module, I took the original code from official material web: Date Picker Examples Angular Material.
<mat-form-field class="example-full-width">
<input matInput [matDatepickerFilter]="myFilter" [matDatepicker]="picker" placeholder="Choose a date">
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<mat-datepicker #picker></mat-datepicker>
</mat-form-field>
Upvotes: 2
Views: 928
Reputation: 106
I had the same issue. I tried to reproduce and got the error: Error: "MatDatepicker: No provider found for DateAdapter documented at https://material.angular.io/components/datepicker/overview#choosing-a-date-implementation-and-date-format-settings Adding MatNativeDateModule to material imported modules worked for me.
Upvotes: 7