vimalavinisha / angular2-google-chart

Angular 2 google chart
MIT License
59 stars 45 forks source link

Please add support for Angular 5 #68

Open danyg opened 6 years ago

danyg commented 6 years ago

Hi, I'm following the instructions as described in README.md, but I doing it in an Angular 5 project just created from ng cli,

I receiving this error in the terminal when using ng serve

ERROR in ./node_modules/angular2-google-chart/directives/angular2-google-chart.directive.ts                                                                                   
Module build failed: Error: D:\LOCAL_DEVEL\MyApp\node_modules\angular2-google-chart\directives\angular2-google-chart.directive.ts is not part of the compilation output
Please check the other error messages for details.                                                                                                                            
    at AngularCompilerPlugin.getCompiledFile (D:\LOCAL_DEVEL\MyApp\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:649:23)                                
    at plugin.done.then (D:\LOCAL_DEVEL\MyApp\node_modules\@ngtools\webpack\src\loader.js:467:39)                                                                      
    at process._tickCallback (internal/process/next_tick.js:109:7)                                                                                                            
 @ ./src/app/app.module.ts 9:0-95                                                                                                                                             
 @ ./src/main.ts                                                                                                                                                              
 @ multi ./src/main.ts                                                                                                                                                        

And I receiving this error in the terminal when using ng serve --aot

ERROR in angular2-google-chart\directives\angular2-google-chart.directive.ts(5,2): Error during template compile of 'GoogleChart'
  Function calls are not supported in decorators but 'ɵmakeDecorator' was called in 'Directive'
    'Directive' calls 'ɵmakeDecorator'.

this is the output of ng -v

D:\LOCAL_DEVEL\MyApp> ng -v

    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/

Angular CLI: 1.6.1
Node: 6.11.3
OS: win32 x64
Angular: 5.1.2
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cdk: 5.0.2
@angular/cli: 1.6.1
@angular/material: 5.0.2
@angular/upgrade: 4.1.3
@angular-devkit/build-optimizer: 0.0.36
@angular-devkit/core: 0.0.22
@angular-devkit/schematics: 0.0.42
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.1
@schematics/angular: 0.1.11
@schematics/schematics: 0.0.11
typescript: 2.4.2
webpack: 3.10.0
RaisoMos commented 6 years ago

Same problem here

stychu commented 6 years ago

Yeah! Would be aweseome to use it with A5. Cant find any solution to get it working.. Need those geoCharts

stychu commented 6 years ago

@RaisoMos @danyg Guys follow those steps !! It worked perfectly in angular 5. Just ApiKey error but its not big deal. Following those instrucitons I was able to create directive for charts and then use any chart. Even the geochart

https://github.com/RicardoVaranda/Angular2-Google-Charts

sayyedimam commented 6 years ago

@stychu Thank you very much for sharing this link, it worked for me. Thanks, -Imam