title: How to extend angular 2 http class in Angular 2 final
body: <p>I'm trying to extent angular 2 http class to be able to handle global errors and set up headers for my secureHttp service. I found some solutions but it doesn't work with final release of Angular 2.
  There is my code: </p>
  
  <p>File: secureHttp.service.ts</p>
  
  <pre><code>import { Injectable } from '@angular/core';
  import { Http, ConnectionBackend, Headers, RequestOptions, Response, RequestOptionsArgs} from '@angular/http';
  
  @Injectable()
  export class SecureHttpService extends Http {
  
    constructor(backend: ConnectionBackend, defaultOptions: RequestOptions) {
      super(backend, defaultOptions);
    }
  }
  </code></pre>
  
  <p>File: app.module.ts</p>
  
  <pre><code>    import { BrowserModule, Title } from '@angular/platform-browser';
  import { NgModule } from '@angular/core';
  import { routing } from './app.routes';
  import { AppComponent } from './app.component';
  import { HttpModule, Http, XHRBackend, RequestOptions } from '@angular/http';
  import { CoreModule } from './core/core.module';
  import {SecureHttpService} from './config/secure-http.service'
  
  @NgModule({
    declarations: [
      AppComponent,
    ],
    imports: [
      BrowserModule,
      CoreModule,
      routing,
      HttpModule,
    ],
    providers: [
      {
        provide: Http,
        useFactory: (backend: XHRBackend, defaultOptions: RequestOptions) =&gt; {
          return new SecureHttpService(backend, defaultOptions);
        },
        deps: [ XHRBackend, RequestOptions]
      }, Title, SecureHttpService],
    bootstrap: [AppComponent],
  })
  export class AppModule { }
  </code></pre>
  
  <p>component.ts</p>
  
  <pre><code>constructor(private titleService: Title, private _secure: SecureHttpService) {}
  
    ngOnInit() {
      this.titleService.setTitle('Dashboard');
      this._secure.get('http://api.example.local')
          .map(res =&gt; res.json())
          .subscribe(
              data =&gt;  console.log(data) ,
              err =&gt; console.log(err),
              () =&gt; console.log('Request Complete')
          );
    }
  </code></pre>
  
  <p>For now it returns me an error 'No provider for ConnectionBackend!'.
  Thanks for help!</p>