3

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?

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
anogin
  • 33
  • 3

2 Answers2

4

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

cgalev
  • 321
  • 2
  • 9
3

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.

Kaivosukeltaja
  • 15,541
  • 4
  • 40
  • 70