2016-11-28 29 views
0

試圖爲食譜指南中描述的整合國際化,
當我運行解壓縮工具來生成XLF文件我得到以下錯誤:角2的i18n提取工具錯誤

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 (position 52:19 in the original .ts file), resolving symbol OrchestratorModule in D:/workspace/frontend/my-app/src/app/orchestrator/orchestrator.module.ts

基本上在線路在模塊聲明的52中,有一個lambda爲HTTP定義了一個自定義提供程序。 我只有i18n提取工具有這個問題。
以前有人遇到過這個嗎?感謝

編輯:從51行代碼,在模塊的供應商部分:

{ 
     provide: Http, 
     useFactory: (backend: XHRBackend, defaultOptions: RequestOptions, 
        auth: AuthenticationService) => { 
     return new LoyHttp(
      backend, defaultOptions, auth); 
     }, 
     deps: [ 
     XHRBackend, RequestOptions, AuthenticationService 
     ] 
    } 
+0

你能顯示代碼嗎? – Riscie

+1

我可以展示它的一部分 –

+0

僅供參考,它適用於構建服務和測試,我只能用i18n的解壓工具得到這個錯誤 –

回答

0

嘗試

export function loyHttp(backend: XHRBackend, defaultOptions: RequestOptions, 
        auth: AuthenticationService) { 

return new LoyHttp(backend, defaultOptions, auth); 

} 

    { provide: Http, useFactory: loyHttp, 
     deps: [XHRBackend, RequestOptions, AuthenticationService] 
    } 

我相信這是解決方案。