title: Get the json values in Http.get
body: <p>I was trying to create a small example in Angular2. What I am doing is when I click a button, this does a get to public api and show a quotes, but I can't, the value never shows and I got the error </p>
  
  <blockquote>
    <p>Cannot read property 'quotes' of undefined in
    [{{quote.contents.quotes.quote}} in App@4:20]</p>
  </blockquote>
  
  <p>My Component.ts</p>
  
  <pre><code>import {Component, OnInit, Injectable} from 'angular2/core';
  import {Http, HTTP_PROVIDERS, URLSearchParams} from 'angular2/http';
  import 'rxjs/add/operator/map';
  
  @Component({
    selector: 'app',
    template: `&lt;ul&gt;
                  &lt;li (click)='myAlert()'&gt; Helow World&lt;/li&gt;
               &lt;/ul&gt;
               &lt;div&gt;
                &lt;spam&gt;{{quote.contents.quotes.quote}}&lt;/spam&gt;
               &lt;/div&gt;`,
    providers: [HTTP_PROVIDERS]
  })
  
  export class App {
    public quote: Object;
    public  logError: string;
  
    constructor(private http: Http){
      this.quote = {};
    }
  
    myAlert(){
        this.http.get("http://quotes.rest/qod.json").map(res =&gt; { return res.json()})
          .subscribe(
            data =&gt; this.quote = data,
            err =&gt; this.logError(err),
            () =&gt; console.log('Random Quote Complete')
        );
  
    }
  }
  </code></pre>
  
  <p>My boot.ts</p>
  
  <pre><code>import {bootstrap} from 'angular2/platform/browser'
  import {App} from './component'
  import {HTTP_PROVIDERS} from 'angular2/http';
  
  bootstrap(App, [HTTP_PROVIDERS]).catch(err =&gt; console.error(err));
  </code></pre>
  
  <p>Index.html</p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;Angular 2 QuickStart&lt;/title&gt;
  
  
      &lt;!-- 1. Load libraries --&gt;
      &lt;script src="node_modules/angular2/bundles/angular2-polyfills.js"&gt;&lt;/script&gt;
      &lt;script src="node_modules/systemjs/dist/system.src.js"&gt;&lt;/script&gt;
      &lt;script src="node_modules/rxjs/bundles/Rx.js"&gt;&lt;/script&gt;
      &lt;script src="node_modules/angular2/bundles/angular2.dev.js"&gt;&lt;/script&gt;
      &lt;script src="https://code.angularjs.org/2.0.0-beta.1/http.js"&gt;&lt;/script&gt;
  
      &lt;!-- 2. Configure SystemJS --&gt;
      &lt;script&gt;
      System.config({
        packages: {
          app: {
            format: 'register',
            defaultExtension: 'js'
          }
        }
      });
        System.import('app/boot')
              .then(null, console.error.bind(console));
      &lt;/script&gt;
  
    &lt;/head&gt;
  
    &lt;!-- 3. Display the application --&gt;
    &lt;body&gt;
      &lt;app&gt;Loading...&lt;/app&gt;
    &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>How Do I get the values from the service's subscribe and put into my template?</p>