File tree 1 file changed +7
-6
lines changed
1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 1
- /*global google*/
2
1
import Component from '@ember/component' ;
3
2
4
3
function createEvent ( name ) {
@@ -13,13 +12,15 @@ export default Component.extend({
13
12
didInsertElement ( ) {
14
13
let script = document . createElement ( 'script' ) ;
15
14
script . onload = ( ) => {
16
- google . charts . load ( 'current' , { packages : [ 'corechart' ] } ) ;
17
- google . charts . setOnLoadCallback ( ( ) => {
18
- window . googleChartsLoaded = true ;
19
- document . dispatchEvent ( createEvent ( 'googleChartsLoaded' ) ) ;
15
+ window . google . load ( 'visualization' , '1.0' , {
16
+ packages : [ 'corechart' ] ,
17
+ callback ( ) {
18
+ window . googleChartsLoaded = true ;
19
+ document . dispatchEvent ( createEvent ( 'googleChartsLoaded' ) ) ;
20
+ } ,
20
21
} ) ;
21
22
} ;
22
23
document . body . appendChild ( script ) ;
23
- script . src = 'https://www.gstatic .com/charts/loader.js ' ;
24
+ script . src = 'https://www.google .com/jsapi ' ;
24
25
} ,
25
26
} ) ;
You can’t perform that action at this time.
0 commit comments