Closed vinagreti closed 7 years ago
That's strange. The following should work as it is. I will double check it.
package.json
"main": "dist/ng2-datetime-picker.umd.js",
"module": "dist/index.js",
"typings": "dist/index.d.ts",
I'm using: "angular-cli": "1.0.0-beta.21", "ng2-datetime-picker": "^0.9.10",
The problem occurs when I run ng serve --aot
or ng build --aot
This plunker works fine without even defining any. https://plnkr.co/edit/ApJNv9?p=preview
//noinspection TypeScriptCheckImport
import { Ng2DatetimePickerModule, Ng2DateTime } from 'ng2-datetime-picker';
Can you upgrade to 0.12.0? Then, let's see what happens.
You are using system.js here, not angular-cli, that uses webpack.
I'll update and let you know what happens!
I have also tested with webpack
and ngc
, and both worked fine
Yes, it works with version 0.12. Thanks a lot! You can close this issue!
When compiling in AOT mode, I'm getting this error:
Uncaught Error: Unexpected value 'Ng2DatetimePickerModule' imported by the module 'AppModule'
To fix it, I had to import the module as follow:
import { Ng2DatetimePickerModule } from 'ng2-datetime-picker/src';
Note that I had to put
/src
at the end of the import statement to compile in AOT mode.To fix it, you have two options: 1 - Change the docs to tell the users that they should import from 'ng2-datetime-picker/src';`; 2 - Place an index.ts exporting the module at the root folder so the compiler will find it in AOT mode.
Using: "angular-cli": "1.0.0-beta.21", "ng2-datetime-picker": "^0.9.10",