vimalavinisha / angular2-google-chart

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

Fails to load component with parse errors #11

Closed KrishnanSriram closed 8 years ago

KrishnanSriram commented 8 years ago

Here's the error I received in rc6

 [ERROR ->]<div id="line_chart",[chartData]="line_ChartData", [chartOptions] = "line_ChartOptions",chartType="Li"): PiechartComponent@2:4 ; Zone: <root> ; Task: Promise.then ; Value: Error: Template parse errors:(…) Error: Template parse errors:
Only void and foreign elements can be self closed "div" ("<!--Div that will hold the pie chart-->
<div>
    [ERROR ->]<div id="line_chart",[chartData]="line_ChartData", [chartOptions] = "line_ChartOptions",chartType="Li"): PiechartComponent@2:4
    at DirectiveNormalizer.normalizeLoadedTemplate (http://localhost:4200/vendor/@angular/compiler/bundles/compiler.umd.js:13501:21)
    at eval (http://localhost:4200/vendor/@angular/compiler/bundles/compiler.umd.js:13494:53)
    at ZoneDelegate.invoke (http://localhost:4200/vendor/zone.js/dist/zone.js:332:29)
    at Zone.run (http://localhost:4200/vendor/zone.js/dist/zone.js:225:44)
    at http://localhost:4200/vendor/zone.js/dist/zone.js:591:58
    at ZoneDelegate.invokeTask (http://localhost:4200/vendor/zone.js/dist/zone.js:365:38)
    at Zone.runTask (http://localhost:4200/vendor/zone.js/dist/zone.js:265:48)
    at drainMicroTaskQueue (http://localhost:4200/vendor/zone.js/dist/zone.js:497:36)
    at XMLHttpRequest.ZoneTask.invoke (http://localhost:4200/vendor/zone.js/dist/zone.js:437:26)

Piechart component is my custom component in which I am trying to load this chart

KrishnanSriram commented 8 years ago

Figured this one out. there were unwanted "," between attributes in div element. Removed it, and I was able to make progress. Changed the following line from <div id="line_chart", [chartData]="line_ChartData", [chartOptions]= "line_ChartOptions", chartType="LineChart", GoogleChart>

To <div id="line_chart" [chartData]="line_ChartData" [chartOptions]= "line_ChartOptions" chartType="LineChart" GoogleChart>