I'm trying to use Google Charts in an Angular CLI (7.2.3) project but am running into an issue getting the typings to work.
First, I installed the typings with this command (both with and without the -dev flag):
npm install --save-dev @types/google.visualization
After doing this, intellisense starts working immediately in Visual Studio Code and I don't get any highlighted errors when I create a simple test like this:
const chartBoxStyle: google.visualization.ChartBoxStyle = {};
However, when I try to build by running ng build, I get this error:
error TS2503: Cannot find namespace 'google'.
I have tried adding this to my file with no luck:
declare const google: any;
My tsconfig.json file has the following for typeRoots and I see the google.visualization folder in there:
"typeRoots": ["node_modules/@types"]
Any help would be greatly appreciated as I'm out of ideas on how to progress past this.
ng new my-app? - Shaun Luttin