I'm trying to import js library money.js
(https://www.npmjs.com/package/money) into an angular 4 component.
I've installed it by npm install money
and added the following code to my component:
declare var fx: any;
import '../../../node_modules/money/money.js';
Within the component i've tried to use it:
fx.convert(12.99, {from: "GBP", to: "HKD"});
Unfortunately, i'm getting an error that fx
is not defined.
It's important to mention that money.js
file DID get loaded (I find it when searching the sources in developer tools).
Can someone assist ?