AndrewPoyntz / time-ago-pipe

An Angular pipe for converting a date string into a time ago
MIT License
130 stars 67 forks source link

Library not ready for AOT #3

Closed echo8795 closed 7 years ago

echo8795 commented 7 years ago

This library is not ready for aot compilation by ngc. It throws this error during AOT compilation Error: Unexpected value 'TimeAgoPipe' declared by the module 'AppModule'

From what ic ould find its missing a file called ".metadat.json". It is required for aot compilation of any angular 2 library. You can read it all about here - https://medium.com/@isaacplmann/getting-your-angular-2-library-ready-for-aot-90d1347bcad#.dugqwr8za

AndrewPoyntz commented 7 years ago

@echo8795 Thanks - I will look into making it AoT friendly as soon as I get a bit of time. The article certainly looks like it'll be useful!

arknotts commented 7 years ago

Just PR'd this :slightly_smiling_face: https://github.com/AndrewPoyntz/time-ago-pipe/pull/4

AndrewPoyntz commented 7 years ago

1.2.0 now published with this in - thanks again!

arknotts commented 7 years ago

@AndrewPoyntz Just noticed, it doesn't like compiling in a project with AoT unless the *.metadata.json files are included in the npm package. Once I copied the two in manually it worked fine. Is there a way the build process could include these into the npm package?

AndrewPoyntz commented 7 years ago

@arknotts yes, sorry I did the publish in a rush & messed it up - good spot! I've just pushed 1.2.1 out which should have them in

arknotts commented 7 years ago

Works great now, thanks!