I'm having trouble including the angular material datepicker in my application.
In my app.module.ts I import it like this:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { MatFormFieldModule, MatCheckboxModule, MatDatepickerModule } from '@angular/material';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
NgbModule.forRoot(),
FormsModule,
AppRoutingModule,
RoutingAppointment,
MatFormFieldModule,
MatCheckboxModule,
MatDatepickerModule
],
exports:[
MatDatepickerModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
And later in my component in the html I call it in the following way (copy paste from the doc of angular material):
<mat-form-field>
<input matInput [matDatePicker]="picker" placeholder="DD/MM/YYYY">
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<mat-datepicker #picker></mat-datepicker>
</mat-form-field>
However, he is giving me the error:
Can not bind to 'matDatePicker' since it is not a known property of 'input'
Does anyone know what I'm doing wrong?