Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 类型脚本中的JavaScript错误new()2_Angular_Ionic2 - Fatal编程技术网

Angular 类型脚本中的JavaScript错误new()2

Angular 类型脚本中的JavaScript错误new()2,angular,ionic2,Angular,Ionic2,我对这条代码感到惊讶: .... this.charts.push(new Chart(document.getElementById("chart0"), {..} ... Html: 可能是什么错误? 我必须在char0上使用ngModel?我不知道怎么做 您导入了图表吗?@noggin182如何导入图表??我只有这个:导入'chart.js'; <ion-row><canvas id="chart0" style="width:512px;height:320px"&g

我对这条代码感到惊讶:

....
this.charts.push(new Chart(document.getElementById("chart0"), {..}
...
Html:

可能是什么错误?
我必须在char0上使用ngModel?我不知道怎么做

您导入了图表吗?@noggin182如何导入图表??我只有这个:导入'chart.js';
<ion-row><canvas id="chart0" style="width:512px;height:320px"></canvas>
    <canvas id="chart0" style="width:512px;height:320px"></canvas>
    <canvas id="chart1" style="width:512px;height:320px"></canvas>
  </ion-row>
Cannot find name 'Chart'.