Angular2/http Exception no ConnectionBackend Angular2/http Exception no ConnectionBackend angular angular

Angular2/http Exception no ConnectionBackend


From Angular 2 RC5 version, in your NgModule file, add:

import { HttpModule } from '@angular/http';@NgModule({    imports:      [        ...        HttpModule ]


Remove HTTP_BINDINGS from your code. They are deprecated and reference HTTP_PROVIDERS, so it's like you're using providers twice.

bootstrap(AppComponent, [HTTP_PROVIDERS]);

Also you don't need providers: [Http] in your component, since you injected HTTP_PROVIDERS in bootstrap. Adding it to the component's providers will create new instance of the service.

@Component({  providers: []})


src/main.ts

import { HTTP_PROVIDERS, ConnectionBackend } from '@angular/http';bootstrap(AppComponent, [  HTTP_PROVIDERS,  ConnectionBackend]);

Using angular-cli@1.0.0-beta.10 and angular@2.0.0-rc.4