没有ConnectionBackend的提供者 [英] No provider for ConnectionBackend

查看:116
本文介绍了没有ConnectionBackend的提供者的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以最近我不得不更新到Angular2 RC.6的最新版本.最大的突破性变化似乎是整个引导过程(通过引入" ngModule).

So recently I had to update to the latest version of Angular2, RC.6. The biggest breaking change seems to be the whole bootstrapping (by "introducing" ngModule).

@NgModule({
    imports: [HttpModule, BrowserModule, FormsModule],
    schemas: [CUSTOM_ELEMENTS_SCHEMA],
    declarations: [AppComponent, ...],
    providers: [FrameService, Http, { provide: $WINDOW,  useValue: window }],
    bootstrap: [AppComponent]
})
class AppModule {

}

platformBrowserDynamic().bootstrapModule(AppModule);

然而,在经历了很多的眼泪,汗水和恳求我所能想到的所有神灵之后……我仍然坚持希望是一系列许多错误中的最后一个错误:

However after a lot of tears, sweat and pleading to all the deities I could come up with... I still remain with what is hopefully the last error in a series of many:

没有ConnectionBackend的提供程序!

这时我要撕掉剩下的最后一束头发,因为我对我所缺少的"一无所知.

At this point I am tearing out the last strains of hair I have left as I am clueless at this point regarding the "what I am missing".

亲切的问候!

推荐答案

Http是多余的

providers: [FrameService, Http, { provide: $WINDOW,  useValue: window }],

因为

imports: [HttpModule, BrowserModule, FormsModule],

已经提供了.

这篇关于没有ConnectionBackend的提供者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆