I have a tons of problems with one project where a lot of code was wrote ar rc4 and now I should migrate it to release version. I don't know how, because in off. google docs migrations process from rc4 to rc5 removed. So I tried to do that manually.
now I have issue with creating http module outside of app.
here is previous code. It used for receiving routes config from server before app starting.
/**
* FakeXSRFStrategy and XRSF_MOCK fix http routes loading before bootstrap()
* https://github.com/angular/angular/issues/9294
*/
class FakeXSRFStrategy implements XSRFStrategy {
public configureRequest(req: Request) {}
}
const XRSF_MOCK = provide(XSRFStrategy, { useValue: new FakeXSRFStrategy() });
const injector = ReflectiveInjector.resolveAndCreate([HTTP_PROVIDERS, XRSF_MOCK]);
const http = injector.get(Http);
After upgrade it not works. I was looking at forums etc. and I found that HttpModule should be used instead HTTP_PROVIDERS in rc5
I tried to do that stuff
import {AsyncRoute} from '@angular/router-deprecated';
import {ReflectiveInjector, provide} from '@angular/core';
import {HttpModule, Http, Request, XSRFStrategy} from '@angular/http';
import 'rxjs/Rx';
const injector = ReflectiveInjector.resolveAndCreate([HttpModule]);
const http = injector.get(Http);
But it's not works. I got message - (SystemJS) No provider for Http! I don't know what to do. Please, help me. Thanks.