Globalize.js - cldr.once is not a function

1k views Asked by At

I'm using Globalize.js script in my app to work with locales. All works well, except currency formating. When I use Globalize.currencyFormatter(currency), I'm getting this error

TypeError: cldr.once is not a function

I don't know where should I get "once" function. I've searched in cldr library (latest version 5.0) and don't see once function. Where it suppose to get from?

2

There are 2 answers

0
Kaivosukeltaja On BEST ANSWER

Globalize.js has a dependency to the CLDR low level manipulation tool cldr.js. once is its method for adding event listeners. Make sure you have loaded cldr.js on the page or included it as part of your build.

0
cgalev On

cldr.once is part of a supplemental library cldr/event.js found in the dist folder of cldr repository