atais / ng2-eonasdan-datetimepicker

A wrapper directive around the Eonasdan Datepicker v4 component.
MIT License
34 stars 23 forks source link

Error in Angular 4 #21

Closed lauritowal closed 6 years ago

lauritowal commented 6 years ago

It doesn't work in angular 4... Any idea why?

ERROR in Error: A2Edatetimepicker is not an NgModule
    at _getNgModuleMetadata (/home/walter/Smartmeter/SMP_Frontend/node_modules/@angular/compiler-cli/src/ngtools_impl.js:140:15)
    at _extractLazyRoutesFromStaticModule (/home/walter/Smartmeter/SMP_Frontend/node_modules/@angular/compiler-cli/src/ngtools_impl.js:109:26)
    at /home/walter/Smartmeter/SMP_Frontend/node_modules/@angular/compiler-cli/src/ngtools_impl.js:129:27
    at Array.reduce (native)
    at _extractLazyRoutesFromStaticModule (/home/walter/Smartmeter/SMP_Frontend/node_modules/@angular/compiler-cli/src/ngtools_impl.js:128:10)
    at Object.listLazyRoutesOfModule (/home/walter/Smartmeter/SMP_Frontend/node_modules/@angular/compiler-cli/src/ngtools_impl.js:53:22)
    at Function.NgTools_InternalApi_NG_2.listLazyRoutes (/home/walter/Smartmeter/SMP_Frontend/node_modules/@angular/compiler-cli/src/ngtools_api.js:91:39)
    at AotPlugin._getLazyRoutesFromNgtools (/home/walter/Smartmeter/SMP_Frontend/node_modules/@ngtools/webpack/src/plugin.js:207:44)
    at _donePromise.Promise.resolve.then.then.then.then.then (/home/walter/Smartmeter/SMP_Frontend/node_modules/@ngtools/webpack/src/plugin.js:443:24)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:169:7)
RijadR commented 6 years ago

same for me too,

XardoniK commented 6 years ago

I changed path in app.module to 'import {A2Edatetimepicker} from "ng2-eonasdan-datetimepicker/src/datetimepicker.module";' but later had issue with 'SimpleChanges' and removed this type data from /node_modules/ng2-eonasdan-datetimepicker/src/datetimepicker.directive.ts -> ngOnChanges

lauritowal commented 6 years ago

@XardoniK did it work afterwards?

XardoniK commented 6 years ago

Unfortunately no. I installed original jquery-datetimepicker plugin(npm) by this author, jquery and moment.js and still had error in console that datetimepicker is not a function. I did some changes in directive.ts but without success. I think you need add original to index.html. Ehh it's really good datetimepicker but wrapper for angular sucks.

fetrarij commented 6 years ago

@XardoniK @Retlawxx This should be fixed with the latest version. Could you try?