0
雖然在我的當前項目實施AOT我碰到下面的錯誤,我使用外部庫AmCharts在路徑Angular 2:找不到名字'AmCharts'。而這樣做AOT
錯誤:無法找到名爲「AmCharts'.Cannot找到名爲‘AmCharts’。
注:每一件事情用出來工作的罰款AOT沒有編譯錯誤
雖然在我的當前項目實施AOT我碰到下面的錯誤,我使用外部庫AmCharts在路徑Angular 2:找不到名字'AmCharts'。而這樣做AOT
錯誤:無法找到名爲「AmCharts'.Cannot找到名爲‘AmCharts’。
注:每一件事情用出來工作的罰款AOT沒有編譯錯誤
需要在組件添加語法
define var AmCharts:any;
爲例
import { Component } from '@angular/core';
import { CustomComponent } from './customCompo';
define var AmCharts:any;
@Component({
selector: 'my-app',
templateUrl: 'app/app.html',
})
export class AppComponent { name = 'Angular'; }
其實這GIT解決,問題是無法找到NameSpace Amcharts,我認爲它的聲明,而不是定義 – sudhir
不準確嗎? – anshuVersatile