I npm i numerals
, then npm i @types/numeral
.
I am trying to use numeral inside my price.model.ts file. So, I imported it: import * as numeral from 'numeral';
But, I'm getting this error: ./src/app/shared/models/price.model.ts:1:0-35 - Error: Module not found: Error: Can't resolve 'numeral' in '\src\app\shared\models'
Right now, I'm just using it to parse the number|string that is coming in. I plan to use it for arithmetic later.
private parseValue(value: number | string): number {
let numeralValue = numeral(value).value();
if (numeralValue === null) throw new Error(`${value} is Nan.`);
return numeralValue.valueOf();
}
There's no squigglies prior to compile. I only get the error on ng serve.
Am I missing something?