2016-09-19 61 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