After installing Angular-cli I am getting this error:
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
In my App.Module.ts it does not like this section of code:
providers: [
// 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]
}
],
EDIT:
with the .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]
}
Is it possible to turn this into a factory class as it does not like this current usage?