I'm getting the error above when using a datepicker with Angular RC.6, ng2-bootstrap 1.1.2 and [email protected].
app.module.ts
import { DatepickerModule } from 'ng2-bootstrap/ng2-bootstrap';
@NgModule({
imports: [DatepickerModule], ...
})
app.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
templateUrl: './my-app.component.html'
})
export class MyAppComponent {
public dt:Date = new Date();
}
my-app.component.html
<datepicker [(ngModel)]="dt"></datepicker>
Any ideas?
you forgot to add FormsModule to imports section in main module
True. Thanks, @valorkin
Most helpful comment
you forgot to add FormsModule to
importssection in main module