anogin
anogin

Reputation: 33

Globalize.js - cldr.once is not a function

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?

Upvotes: 3

Views: 1169

Answers (2)

cgalev
cgalev

Reputation: 431

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

Upvotes: 4

Kaivosukeltaja
Kaivosukeltaja

Reputation: 15735

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.

Upvotes: 3

Related Questions