【发布时间】:2017-06-10 08:48:15
【问题描述】:
在使用我的自定义组件时遇到以下问题。
错误:静态解析符号值时遇到错误。不支持函数调用。考虑更换 t 引用导出函数的函数或 lambda,解析 E:/AOT/systemjs-aot-16 中的符号 getValue 62901741/src/
core.ts
export function getValue(
):any{ return "";}
cus-component.ts
import { getValue } from './core.ts';
export let compTest = getValue();
app.module.ts
import { compTest } from './cus-component';
@NgModule({
imports: [BrowserModule, FormsModule, HttpModule, RouterModule.forRoot(rootRouterConfig, { useHash: true })],
declarations: [ HomeComponent,compTest ],
bootstrap: [AppComponent]
})
export class AppModule { }
【问题讨论】:
-
我认为您需要提供更多代码。完全不清楚这段代码在哪里。服务、组件、装饰器、类外、...
-
你找到解决办法了吗?
-
仅供参考
function f():any{ return "";}太糟糕了
标签: angular typescript angular2-aot