angular-formatter-parser icon indicating copy to clipboard operation
angular-formatter-parser copied to clipboard

Angular 5

Open paxpelus opened this issue 7 years ago • 3 comments

I have followed your instruction and I am trying to implement on Angular 5. But there is a strange thing that when using ng server everything works fine, but when I am building for production I am getting

main.d32a5818ac6f3d928ac5.bundle.js:1 ERROR Error: Formatter or Parser with name currencyFormat is not provided as a function via FormatterParser service or FORMATTER_PARSER InjectionToken. Did you forgot to provide them? at n.getFormatParseFunction (main.d32a5818ac6f3d928ac5.bundle.js:1)

Has anyone else found a similar problem with angular 5?

paxpelus avatar Jan 25 '18 16:01 paxpelus

I'm getting the same error with a custom formatter in angular 5 build. works fine in ng serve. Been banging my head for hours without success. Please assist. Anyone.

Nyaruiru avatar Apr 20 '18 10:04 Nyaruiru

It does not look like this library could handle minification properly

gms1 avatar Apr 22 '18 14:04 gms1

Observation: Inbuilt functions work in ng serve and build. custom functions work in ng serve but fail in build. FORMATTER_PARSER injection token fails somehow in build. Solution: I bypassed the FORMATTER_PARSER injection token and included my custom js function in the transpiled FormatterParser class in index.js in node modules. Works like a charm. Couldn't find a more fitting solution to make a pull request.

Nyaruiru avatar Apr 22 '18 15:04 Nyaruiru