Giter Club home page Giter Club logo

Comments (6)

nachomozo avatar nachomozo commented on September 26, 2024 3

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.

nachomozo avatar nachomozo commented on September 26, 2024 1

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.

nachomozo avatar nachomozo commented on September 26, 2024

Same error here! Any solution?

from angular2-google-chart.

vimalavinisha avatar vimalavinisha commented on September 26, 2024

@nachomozo

 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.

smasherprog avatar smasherprog commented on September 26, 2024

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.

mukulsoftwap avatar mukulsoftwap commented on September 26, 2024

I have also same issue

from angular2-google-chart.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.