Comments (6)
I have tried the new pack and the error persists.
In AoT mode fails when compile:
ERROR in Error encountered resolving symbol values statically. Calling function 'ɵmakeDecorator', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol Injectable in /Users/xxx/development/xxx/node_modules/angular2-google-chart/node_modules/@angular/core/core.d.ts, resolving symbol ɵf in /Users/xxx/development/xxx/node_modules/angular2-google-chart/node_modules/@angular/core/core.d.ts, resolving symbol ɵf in /Users/xxx/development/xxx/node_modules/angular2-google-chart/node_modules/@angular/core/core.d.ts
ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/Users/xxx/development/xxx/src'
@ ./src/main.ts 4:0-74
@ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts
webpack: Failed to compile.
With JIT throws an error on the console:
compiler.es5.js:1689 Uncaught Error: Unexpected value 'GoogleChart' declared by the module 'AppModule'. Please add a @Pipe/@Directive/@Component annotation.
at syntaxError (http://localhost:4200/vendor.bundle.js:45559:34)
at http://localhost:4200/vendor.bundle.js:59291:40
at Array.forEach (native)
at CompileMetadataResolver.webpackJsonp.../../../compiler/@angular/compiler.es5.js.CompileMetadataResolver.getNgModuleMetadata (http://localhost:4200/vendor.bundle.js:59273:54)
at JitCompiler.webpackJsonp.../../../compiler/@angular/compiler.es5.js.JitCompiler._loadModules (http://localhost:4200/vendor.bundle.js:70550:70)
at JitCompiler.webpackJsonp.../../../compiler/@angular/compiler.es5.js.JitCompiler._compileModuleAndComponents (http://localhost:4200/vendor.bundle.js:70523:36)
at JitCompiler.webpackJsonp.../../../compiler/@angular/compiler.es5.js.JitCompiler.compileModuleAsync (http://localhost:4200/vendor.bundle.js:70452:37)
at PlatformRef_.webpackJsonp.../../../core/@angular/core.es5.js.PlatformRef_._bootstrapModuleWithZone (http://localhost:4200/vendor.bundle.js:76194:25)
at PlatformRef_.webpackJsonp.../../../core/@angular/core.es5.js.PlatformRef_.bootstrapModule (http://localhost:4200/vendor.bundle.js:76180:21)
at Object.../../../../../src/main.ts (http://localhost:4200/main.bundle.js:2033:124)
from angular2-google-chart.
In my case, it seems there is a problem with some format or annotations in the google charts directive.
I write my own directive google-chart.directive.ts from scratch, following the Angular 4 specifications, and it works:
import {Directive, ElementRef, Input, OnChanges} from '@angular/core';
declare let google: any;
declare let googleLoaded: any;
declare let googleChartsPackagesToLoad: any;
@Directive({
selector: '[appGoogleChart]'
})
export class GoogleChartDirective implements OnChanges {
public _element: any;
@Input('chartType') public chartType: string;
@Input('chartOptions') public chartOptions: Object;
@Input('chartData') public chartData: Object;
constructor(public element: ElementRef) {
this._element = this.element.nativeElement;
}
ngOnChanges() {
if (!googleLoaded) {
googleLoaded = true;
google.charts.load('current', {'packages':['corechart', 'gauge']['orgchart']});
}
setTimeout(() => this.drawGraph(this.chartOptions, this.chartType, this.chartData, this._element), 1000);
}
drawGraph (chartOptions, chartType, chartData, ele) {
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
let wrapper;
wrapper = new google.visualization.ChartWrapper({
chartType: chartType,
dataTable: chartData ,
options: chartOptions || {}
});
wrapper.draw(ele);
}
}
}
from angular2-google-chart.
Same error here! Any solution?
from angular2-google-chart.
I have formatted code and removed commented line from decorator declaration. Could you take a recent pack v 2.2.5 and check.
from angular2-google-chart.
I ran into this problem as well, the fix is to add the following line to your "paths" in your tsconfig.json that is used by the cli
"@angular/": [ "../node_modules/@angular/" ]
You can see the fix here
angular/angular-cli#4647 (comment)
from angular2-google-chart.
I have also same issue
from angular2-google-chart.
Related Issues (20)
- Google Calendar Chart HOT 1
- Unexpected value 'GoogleChart' declared by the module 'AppModule' HOT 1
- Unexpected value 'GoogleChart' declared by the module 'AppModule'. Please add a @Pipe/@Directive/@Component annotation. HOT 8
- how to use redraw method?
- Does angular2-google-chart works with angular4 cli? HOT 2
- Getting compiling error
- node_modules/angular2-google-chart/directives/angular2-google-chart.directive.ts(33,15): error TS7006: Parameter 'chartOptions' implicitly has an 'any' type
- How can i colered BarChart?
- Please add support for Angular 5 HOT 4
- compile error HOT 3
- angular2-google-chart
- node_modules\angular2-google-chart\directives\angular2-google-chart.directive.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property. HOT 6
- Timline chart is not loading (Invalid visualization type: timeline)
- How to set colors in pie chart?
- Despite having container div set to width 100 %, chart is not filling up the container.
- how to change value in line chat right hand side value (0,400,8001200,1600) and change the symbol Sales and Expenses
- Incompatible data table: Error: Unknown address type. HOT 1
- angular2-google-chart.directive.ts is missing from the TypeScript compilation.
- Pie Chart - ERROR Error: Invalid column index null. Should be an integer in the range [0-1]
- Chart Background Color
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular2-google-chart.