You need to specify HTTP_PROVIDERS:
const injector = ReflectiveInjector.resolveAndCreate([
HTTP_PROVIDERS,
XHRConnection,
{
provide: Http,
useFactory: (backend, defaultOptions) => new Http(backend, defaultOptions),
deps: [XHRConnection, BaseRequestOptions]
}
]);
source
share