title: angular 2 rc - Cannot read property 'request' of undefined
body: <p>This is my code and I couldn't figure out nor find a solution for my problem. I am sorry if the answer exists somewhere and couldn't find it.</p>
  
  <p>This is the app.component.ts file</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import {Component} from '@angular/core';
  import { HTTP_PROVIDERS} from '@angular/http';
  import {SimpleHTTPComponent} from './simplehttp'
  
  
  @Component({
    selector: 'my-app',
    providers: [HTTP_PROVIDERS],
    template: `
      &lt;div&gt;
        &lt;simple-http&gt;&lt;/simple-http&gt;
      &lt;/div&gt;
    `,
    directives: [SimpleHTTPComponent]
  })
  export class AppComponent {
   
   data: Object;
   loading: boolean;
   constructor() {
     }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>This is my simplehttp.ts file</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import {Component} from '@angular/core';
  import {Http, Response} from '@angular/http';
  import { HTTP_PROVIDERS } from '@angular/http';
  import {Inject} from '@angular/core'
  
  
  @Component({
  selector: 'simple-http',
  template: `
   &lt;h2&gt;Basic Request&lt;/h2&gt;
   &lt;button type="button" (click)="makeRequest()"&gt;Make Request&lt;/button&gt;
   &lt;div *ngIf="loading"&gt;loading...&lt;/div&gt;
   &lt;pre&gt;{{data | json}}&lt;/pre&gt;`,
  providers:[HTTP_PROVIDERS]
  })
  export class SimpleHTTPComponent {
   data: Object;
   loading: boolean;
   http: Http;
   constructor( @Inject(Http) private _http: Http){
    
   }
   makeRequest():void{
    this.loading = true;
    this.http.request('http://jsonplaceholder.typicode.com/posts/1')
    .subscribe((res: Response) =&gt; {
    this.data = res.json();
    this.loading = false;
    });
   }
  
  }</code></pre>
  </div>
  </div>
  </p>