Ngx-bootstrap: Can't bind to 'ngModel' since it isn't a known property of 'datepicker'

Created on 14 Sep 2016  路  2Comments  路  Source: valor-software/ngx-bootstrap

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?

Most helpful comment

you forgot to add FormsModule to imports section in main module

All 2 comments

you forgot to add FormsModule to imports section in main module

True. Thanks, @valorkin

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ctrl-brk picture ctrl-brk  路  3Comments

tpiros picture tpiros  路  3Comments

Scooviese picture Scooviese  路  3Comments

phmello picture phmello  路  3Comments

pgeyman picture pgeyman  路  3Comments