title: Ionic2 angular2 http get json from external api
body: <p>I am aware that this might be a noob question since I've seen more complicated stuff, but to understand the complicated I need to understand the easy stuff first.</p>
  
  <p>I am trying to get the name from a JSON string from an api (laravel):</p>
  
  <pre><code>{"name":"Abigail","state":"CA"}
  </code></pre>
  
  <p>The code is created with a route which returns this (in laravel):</p>
  
  <pre><code>return response()-&gt;json([
      'name' =&gt; 'Abigail',
      'state' =&gt; 'CA'
  ]);
  </code></pre>
  
  <p>In ionic I got these files:</p>
  
  <p>page.ts:</p>
  
  <pre><code>export class Page {
    constructor(public http: Http) {}
      getJson() {
        this.http.get('http://external.ip/api')
            .map(res =&gt; res.json())
            .subscribe(
            data =&gt; this.data = data
        );
      }
  }
  </code></pre>
  
  <p>page.html:</p>
  
  <pre><code>&lt;ion-header&gt;
    &lt;ion-navbar&gt;
      &lt;ion-title&gt;App&lt;/ion-title&gt;
    &lt;/ion-navbar&gt;
  &lt;/ion-header&gt;
  &lt;ion-content padding&gt;
    &lt;ion-content&gt;
      &lt;ion-list&gt;
        &lt;ion-item&gt;
          &lt;h3&gt;{{data.name}}&lt;h3&gt;
        &lt;/ion-item&gt;
      &lt;/ion-list&gt;
    &lt;/ion-content&gt;
  &lt;/ion-content&gt;
  </code></pre>
  
  <p>I know this doesn't work, but I need help to get this working.
  I want to be able to add more names later on.
  And after that I want to be able to post data to the api (for example add a name or change a date).</p>