I'm trying to load the google charts library.
I declared google
as a global variable using the following piece of code:
declare var google:any;
Now, in ngOnInit()
, I'm doing
google.charts.load('current',{packages:['geochart']);
google.charts.setOnLoadCallback(this.drawMap());
And, now, in drawMap():
console.log("google", this.google);
console.log("google.visualization", this.google.visualization);
How is it possible for an object to have property in one line and that property is undefined in the next line..?