title: Get request doesn't work - Angular 4
body: <p>I'm new to Angular 4, I'm trying to make  simple app with an api. But the Get request doesn't work and I don't understand what the problem is.</p>
  
  <p>My Service :</p>
  
  <pre><code>import { Injectable } from '@angular/core';
  import { Http, Response } from '@angular/http';
  
  import 'rxjs/add/operator/map';
  
  @Injectable()
  export class RequestService {
  
  // persos:any;
  
  
  constructor(private http:Http) {
  
      this.getPersos();
  
  }
  
  getPersos() {
  
      return this.http.get(this.apiUrl + 'people/')
          .map(response =&gt; {
              return response.json(),
              console.log(response.json());
          })
  }
  </code></pre>
  
  <p>My component file :</p>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  import { Http, Response, RequestOptions } from '@angular/http';
  import { RequestService } from '../services/requests.service'
  
  @Component({
    selector: 'persos',
    templateUrl: './persos.component.html',
    styleUrls: ['./persos.component.css'],
    providers: [RequestService]
  })
  
  
  export class PersosComponent implements OnInit {
  
  constructor(private requestService:RequestService) {
      console.log(this.persos);
  }
  
  title = 'List des personnages';
  persos;
  
  ngOnInit() {
  
      this.requestService.getPersos()
          .subscribe(persos =&gt; {
              this.persos = persos;
              console.log(this.persos);
          }) 
  }
  
  }
  </code></pre>
  
  <p>In the service file, I put a log who return to me the good datas, bu the console.log inside the component file return 'undefined'.</p>
  
  <p>I didn't find a solution yet.
  Thanks by advance. </p>