0

I'm trying to use the ng2-datepicker but after I installed it from npm I can't import the module.

app.module.ts:

import { DatePicker } from 'ng2-datepicker/ng2-datepicker';

import { AppComponent } from './app.component';

@NgModule({
   declarations: [
   Appcomponent,
   DatePicker
   ],

The DatePicker doesn't exists.

Arnaud Denoyelle
  • 29,980
  • 16
  • 92
  • 148
Tomer Kohn
  • 243
  • 1
  • 8

1 Answers1

1

Two issues, the first is that you should import from 'ng2-datepicker';

The second is that you ought to import DatePickerModule and not just DatePicker:

import { DatePickerModule } from 'ng2-datepicker';

import { AppComponent } from './app.component';

@NgModule({
   declarations: [
   Appcomponent,
   DatePickerModule
   ],
silentsod
  • 8,165
  • 42
  • 40