title: read json from server with ionic 3 (angular 4)
body: <h2>I have a provider that get data from local server that gives me response</h2>
  
  <p>I have a provider that get data from local server that gives me response </p>
  
  <pre><code>    import { HttpClient } from '@angular/common/http';
      import { Injectable } from '@angular/core';
      import 'rxjs/add/operator/map';
      import 'rxjs/add/operator/catch';
      import {Observable} from 'rxjs/Rx';
  
  
      @Injectable()
      export class UserProvider {
  
        baseUrl;
        constructor(public http: HttpClient) {
          this.baseUrl = "http://127.0.0.1:8000/api/";
        }
  
        public getUser(): Observable&lt;any&gt; {
          return this.http.get(this.baseUrl + "user/1")
            .map( (response: Response) =&gt; {
            const data = response;
            return data; } );
        }
  
  
      }
  </code></pre>
  
  <h2>On a page i subscribe on it in getUser() function and try to hadle it</h2>
  
  <pre><code>      import {Component} from '@angular/core';
        import {NavController} from 'ionic-angular';
        import {UserProvider} from "../../providers/user/user";
  
        @Component({
          selector: 'page-home',
          templateUrl: 'home.html'
        })
        export class HomePage {
  
          user: any;
  
          constructor(
            public navCtrl: NavController,
            private userProvider:UserProvider,
          ) {        
  
  
          }
  
          ngOnInit(){
            this.getUser();
          }
  
  
  
          getUser(){
            this.userProvider.getUser().subscribe(data =&gt;{
              console.log(data);
              this.user = data;
            });
          }
  
  
        }
  </code></pre>
  
  <h2>But user still undefined and i cant get fields of the object, what is wrong with that?</h2>