Closed 0cv closed 7 years ago
But still...
which command did you run or how did you produce this log?
I am a Chinese,I can read but not good at write...
This module has just been updated, could you run it again with the new version 0.11.0? Now every .ts has .metadata.json, which works for AoT.
ok,I give it a try..
thank you
still have same wrong....... this is my .ts file
@HerokunTan not sure where your issue comes from, but I can tell you that it works for me perfectly fine in my project. Ensure you're really using the 0.11.0 version npm install ng2-datetime-picker@0.11.0 --save
as npm is not even updated at the time we speak: https://www.npmjs.com/package/ng2-datetime-picker
If that still does not work, double check your tsconfig.json
which could well be have a glitch. In my case, the most relevant parts are:
...
"target": "es5",
"module": "es2015",
"moduleResolution": "node",
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"noEmitHelpers": true,
"strictNullChecks": false,
"rootDirs": [".", "node_modules"],
"outDir": "./dist",
"removeComments": true,
...
and also:
"angularCompilerOptions": {
"genDir": "dist",
"skipMetadataEmit" : true,
"debug": true
},
@Krisa, .ngfactory.d.ts have been removed. Is this necessary?
@allenhwkim normally we need only the .js files (i.e. no *.ts). When I look at the module I installed from Npm, this looks good:
Actually, only the dist/ folder is needed (without dist/src). app/ and src/ could be gone but this does not change much here anyway. And in the dist/ folder, we can see the *.metadata.json files, so all feel good
It will be work for me but have another issue
I change datetime-picker.component.d.ts file source code and it work for me now @Krisa thanks!
@HerokunTan you shall not need to edit these source files. Are you sure you're really using the latest version? Seeing the screenshot above (2 posts ago), node_modules/ng2-datetime-picker/dist/datetime-picker.component.ngfactory.ts
is not existing in my case... Please check the version field in node_modules/ng2-datetime-picker/package.json
, that shall be 0.11.0.
Hi, fresh install of 0.11.2 here. Same problem:
ERROR in [default] [...]\src\compiled\node_modules\ng2-datetime-picker\dist\datetime-picker.component.ngfactory.ts:327:21 Property '_hours' is private and only accessible within class 'DateTimePickerComponent'.
ERROR in [default] [...]\src\compiled\node_modules\ng2-datetime-picker\dist\datetime-picker.component.ngfactory.ts:333:21 Property '_minutes' is private and only accessible within class 'DateTimePickerComponent'.
Perhaps this is caused by combining @ViewChild
with private
?
0.11.3 changed _hours, _minutes to public.
Thank you! Now AOT compilation works for me.
This will resolve https://github.com/ng2-ui/ng2-datetime-picker/issues/67
Build must now be run with
npm run ngc