webpack AOT cannot use functions

269 views Asked by At

I integrated webpack into my angular2 application.

I have encountered an error:

Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing the function or lambda with a reference to an exported function

Some of them could be fixed by reworking this

{provide: MY_SERVICE, useFactory: () => newService(api), deps: [Api]}

to:

export function newService(api: Api) {new Service(api)} 
...   
{provide: MY_SERVICE, useFactory: newService, deps: [Api]}

But how do I solve importing a module which requires .forRoot?

TNSFontIconModule.forRoot({'flaticon': 'flaticon.css'})
0

There are 0 answers