Angular2提供
Angular2 Provide
我今天将我的项目升级到 Angular RC 到 Final,我在转换时遇到了问题 =>
provide(Http, {
useFactory: (xhrBackend: XHRBackend, requestOptions: RequestOptions, accountEventService: AccountEventsService) => {
return new HmacHttpClient(xhrBackend, requestOptions, accountEventService);
},
deps: [XHRBackend, RequestOptions, AccountEventsService],
multi: false
}
我尝试使用与最终版本相同的代码,但我没有找到解决方案。
感谢您的帮助
语法已更改为对象文字,如:
{provide: Http,
useFactory: (xhrBackend: XHRBackend, requestOptions: RequestOptions, accountEventService: AccountEventsService) => {
return new HmacHttpClient(xhrBackend, requestOptions, accountEventService);
},
deps: [XHRBackend, RequestOptions, AccountEventsService],
multi: false
}
我今天将我的项目升级到 Angular RC 到 Final,我在转换时遇到了问题 =>
provide(Http, {
useFactory: (xhrBackend: XHRBackend, requestOptions: RequestOptions, accountEventService: AccountEventsService) => {
return new HmacHttpClient(xhrBackend, requestOptions, accountEventService);
},
deps: [XHRBackend, RequestOptions, AccountEventsService],
multi: false
}
我尝试使用与最终版本相同的代码,但我没有找到解决方案。
感谢您的帮助
语法已更改为对象文字,如:
{provide: Http,
useFactory: (xhrBackend: XHRBackend, requestOptions: RequestOptions, accountEventService: AccountEventsService) => {
return new HmacHttpClient(xhrBackend, requestOptions, accountEventService);
},
deps: [XHRBackend, RequestOptions, AccountEventsService],
multi: false
}