title: How to get data from observable in angular2
body: <p>I am trying to print the result of <code>http</code> call in <code>Angular</code> using <code>rxjs</code></p>
  
  <p>Consider the following code</p>
  
  <pre><code>import { Component, Injectable, OnInit } from '@angular/core';
  import { Http, HTTP_PROVIDERS } from '@angular/http';
  import 'rxjs/Rx';
  
  @Injectable()
  class myHTTPService {
    constructor(private http: Http) {}
  
    configEndPoint: string = '/my_url/get_config';
  
    getConfig() {
  
      return this.http
        .get(this.configEndPoint)
        .map(res =&gt; res.json());
    }
  }
  
  @Component({
      selector: 'my-app',
      templateUrl: './myTemplate',
      providers: [HTTP_PROVIDERS, myHTTPService],
  
  
  })
  export class AppComponent implements OnInit {
  
      constructor(private myService: myHTTPService) { }
  
      ngOnInit() {
        console.log(this.myService.getConfig());
      }
  }
  </code></pre>
  
  <p>Whenever I tried to print out the result of <code>getconfig</code> it always return </p>
  
  <pre><code>Observable {_isScalar: false, source: Observable, operator: MapOperator}
  </code></pre>
  
  <p>even though I return a json object instead.</p>
  
  <p>How would I print out the result of <code>getConfig</code> ?</p>