How do I load the Globalize library along with the CLDR data in an Angular app generated from angular cli. When I perform the following steps:
npm install globalize cldr-data
import {Globalize} from 'globalize';
in app.component.ts
ng serve
I get this error:
Can't resolve 'cldr' in '/Users/temp-user/cldr-app/node_modules/globalize/dist'
@ ./~/globalize/dist/globalize.js 22:2-25:14
@ ./~/globalize/dist/node-main.js
@ ./src/app/app.component.ts
@ ./src/app/app.module.ts
@ ./src/main.ts
@ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts
EDIT:
Also tried including it in scripts
in angular-cli.json
"scripts": [
"../node_modules/cldrjs/dist/cldr.js",
"../node_modules/globalize/dist/globalize.js"
],
just including any library wont suffice to use it, you need to configure it in angular-cli.json
file.
"scripts": [
... path to global libraray
]
Read more about Global Library Installation here .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.