window.google is undefined with Angular js

445 views Asked by At

I'm using angular-google-chart version 0.0.11 even i tried with 0.1.0 version

it always failed at

window.google.load('visualization', apiConfig.version, settings);

When I debug it, I found window.google is undefined

I also tried the below solution and that also did not work for me.

https://github.com/angular-google-chart/angular-google-chart/issues/267

Could someone help me out.

1

There are 1 answers

1
David Folch Agulles On

Try to put your line inside window.onload to make sure the library is loaded.

window.onload = () => {
    window.google.load('visualization', apiConfig.version, settings);
}