當我使用angular2 AOT,我得到一個錯誤:angular2 AOT誤差函數調用不suppoted
Function calls are not supported. Consider replacing the function or lambda with a reference to an exported function (position 54:17 in the original .ts file), resolving symbol COMPILER_PROVIDERS in
,並在我的指令模塊,我有這樣的代碼:
import { COMPILER_PROVIDERS } from '@angular/compiler';
@NgModule({
/*imports ...*/
providers: [
COMPILER_PROVIDERS,
]
})
我明白我應該將COMPILER_PROVIDERS更改爲導出函數,但是當我檢查@ angular/compiler的源代碼時,我發現這個:
export declare const COMPILER_PROVIDERS: Array<any | Type<any> | {
[k: string]: any;
} | any[]>;
export declare class RuntimeCompilerFactory implements CompilerFactory {
private _defaultOptions;
constructor(defaultOptions: CompilerOptions[]);
createCompiler(options?: CompilerOptions[]): Compiler;
}
我不知道COMPILER_PROVIDERS是如何工作的,我不知道如何將它傳輸到模塊中的導出函數。 如果有人能幫助我,我將不勝感激!
有同樣的問題,還沒有找到解決方案... – Sebastian