akmittal / angular2-datepicker

Angular2 date time picker
https://www.npmjs.com/package/angular2-datepicker
9 stars 17 forks source link

Does not work out of the box #4

Open drewjocham opened 7 years ago

drewjocham commented 7 years ago

I looked at the following site https://www.npmjs.com/package/angular2-datepicker and it did not work. I did the following:

Added import {MyDatePicker} from 'MyDatePicker/src/index'; to my @NgModule({ than <my-date-picker [options]="myDatePickerOptions" (dateChanged)="onDateChanged($event)" [selDate]="selectedDate"></my-date-picker> and it says unknown HTML tag

In the console it says:

Unhandled Promise rejection: Cannot find module "MyDatePicker/src/index" ; Zone: angular ; Task: Promise.then ; Value: ZoneAwareError Error: Cannot find module "MyDatePicker/src/index"

krislefeber commented 7 years ago

I'm not sure of the proper way to handle this, but I was able to resolve it by linking to the actual module.ts file under the node_modules folder. It was something along the lines of "path to main folder/node_modules/mydatepicker/src/my-date-picker