I'm trying to make use of Angular Material design, but I keep running into this error
Can't bind to 'mdDatepicker' since it isn't a known property of 'input'.
I'm following this documentation to install MD.
I have imported the following into my app.module.ts
/* Material Design */
import { MdDatepickerModule, MdNativeDateModule } from "@angular/material";
and added it to @NgModule
@NgModule({
imports:
[
...
BrowserModule,
BrowserAnimationsModule,
HttpModule,
/* Material Design */
MdDatepickerModule,
MdNativeDateModule,
],
In my component template I just copy pasted the example's code
<md-form-field>
<input mdInput [mdDatepicker]="picker" placeholder="Choose a date">
<md-datepicker-toggle mdSuffix [for]="picker"></md-datepicker-toggle>
<md-datepicker #picker></md-datepicker>
</md-form-field>
I don't do anything special in my component.ts file
import { Component, Input, Output, EventEmitter } from "@angular/core";
import { TranslationPipe } from "../../../pipes";
@Component({
selector: "date-picker",
templateUrl: "./date-picker.component.html",
styleUrls: ["./date-picker.component.scss"],
})
export class DatePickerComponent {
@Input()
date;
constructor(
private translationPipe: TranslationPipe,
) {
}
}
I'm stuck here and I can't find any solutions to this. The only solution I found was Can't bind to 'mdDatepicker' since it isn't a known property of 'input' - Angular but as you can see I implemented it and it didn't help me.
I guessing I'm looking over something, or did I miss a step?
Thanks in advance