Reputation: 13
Ng2-datepicker (1.0.6) Angular2 (2.0.0-rc.5)
When i try to use it in html as in their docs i got this error:
zone.js:484 Unhandled Promise rejection: Template parse errors:
Can't bind to 'ngModel' since it isn't a known property of 'datepicker'.
("
</div>
<div class="form-input">
<datepicker [ERROR ->][(ngModel)]="notice.date"></datepicker>
</div>
</div>
"): AddNoticeComponent@17:24 ; Zone: <root> ; Task: Promise.then ; Value:
Upvotes: 1
Views: 1040
Reputation: 63
Please add below code in .ts file
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
@NgModule({
declarations: [
],
imports: [
FormsModule,
HttpModule,
],
})
Upvotes: 0
Reputation: 657048
Add it to declarations: [...]
of an @NgModule()
and also add imports: [CommonModule, FormsModule, ReactiveFormsModule]
to this @NgModule()
Upvotes: 0