【发布时间】:2017-05-06 18:38:08
【问题描述】:
当我尝试在引导应用程序模块之前调用 ajax 请求时。我得到了。
let injector = ReflectiveInjector.resolveAndCreate([
Http,
BrowserXhr,
{provide: RequestOptions, useClass: BaseRequestOptions},
{provide: ResponseOptions, useClass: BaseResponseOptions},
{provide: ConnectionBackend, useClass: XHRBackend}
]);
this._http = injector.get(Http);
【问题讨论】:
-
我认为这应该用 angular 标记而不是 angularjs。还有什么是你得到的错误。
-
@Senthil。使用完整的错误消息更新屏幕截图
-
您是否尝试过创建像stackoverflow.com/questions/39491647/… 中所示的提供程序?
-
看看这个 repo 以进行 http 调用 rahulrsingh09.github.io/AngularConcepts
标签: angular