2016-09-19 59 views
1

我今天我的項目升級到RC角到決賽,我必須轉換問題=>Angular2提供

provide(Http, { 
    useFactory: (xhrBackend: XHRBackend, requestOptions: RequestOptions, accountEventService: AccountEventsService) => { 
     return new HmacHttpClient(xhrBackend, requestOptions, accountEventService); 
    }, 
    deps: [XHRBackend, RequestOptions, AccountEventsService], 
    multi: false 
} 

我嘗試使用與最終版本相同的代碼,但我不發現了一些解決方案。

感謝的對你有所幫助

回答

1

的語法已更改爲對象常量,如:

{provide: Http, 
    useFactory: (xhrBackend: XHRBackend, requestOptions: RequestOptions, accountEventService: AccountEventsService) => { 
     return new HmacHttpClient(xhrBackend, requestOptions, accountEventService); 
    }, 
    deps: [XHRBackend, RequestOptions, AccountEventsService], 
    multi: false 
} 
+1

感謝對你的幫助 – Hantse