title: Getting JSON Data using Http in Ionic 3
body: <p>Having troubles with Ionic getting data from a JSON File via HTTP, I dont know what is the problem the error is quite strange.</p>
  
  <p><a href="https://i.stack.imgur.com/L2nVo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/L2nVo.png" alt="error message in chrome devtool"></a></p>
  
  <p>here are the codes :</p>
  
  <p><code>src/pages/subhome/line/line.ts</code> (The Subhome contains a few folders of pages)</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import { Component } from '@angular/core';
  import { IonicPage, NavController, NavParams } from 'ionic-angular';
  import { Http } from '@angular/http';
  import 'rxjs/add/operator/map';
  /**
   * Generated class for the LinePage page.
   *
   * See http://ionicframework.com/docs/components/#navigation for more info
   * on Ionic pages and navigation.
   */
  
  @IonicPage()
  @Component({
    selector: 'page-line',
    templateUrl: 'line.html',
  })
  export class LinePage {
  
    commands: any[] = []
  
    constructor(public navCtrl: NavController, public navParams: NavParams, private http: Http) {
      this.http.get('line.json').map(res =&gt; res.json()).subscribe((data) =&gt; {
        this.commands = data.json();
        console.log(this.commands);
      })
    }
  
    ionViewDidLoad() {
      console.log('ionViewDidLoad LinePage');
    }
  
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>and here is the JSON file :</p>
  
  <p><code>src/pages/subhome/line/line.json</code></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>{
   "commands": [{
     "title": "a",
     "desc": "b"
    },
    {
     "title": "a",
     "desc": "b"
    },
    {
     "title": "a",
     "desc": "b"
    },
    {
     "title": "a",
     "desc": "b"
    }
   ]
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p><strong>What I'm trying to do is "logging" the JSON commands to the console</strong>
  Thanks in advance!</p>