安装角CLI后,我得到这个错误:
Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing the function or lambda with a refer
ence to an exported function (position 55:19 in the original .ts file), resolving symbol AppModule in C:/TM-2013/Debt/Debt Platform/Code/main/Think.Debt.Presentation/deb-explorer-with-angular
-cli/src/app/app.module.ts
在我的App.Module.ts它不喜欢的这部分代码:
供应商:
// These are needed throughout the site
AppConfigService,
{ provide: APP_INITIALIZER, useFactory: configServiceFactory, deps: [AppConfigService], multi: true },
{
provide: HttpService,
useFactory: (backend: XHRBackend, options: RequestOptions) => {
return new HttpService(backend, options);
},
deps: [XHRBackend, RequestOptions]
}
]
编辑:
与.load
{ provide: APP_INITIALIZER, useFactory: (config: AppConfigService) => () => config.load(), deps: [AppConfigService], multi: true },
{
provide: HttpService,
useFactory: (backend: XHRBackend, options: RequestOptions) => {
return new HttpService(backend, options);
},
deps: [XHRBackend, RequestOptions]
}
是否有可能变成一个工厂类,这是它不喜欢这个当前的使用情况?