title: Ionic3 : JSON to an array
body: <p>I'm trying to convert a JSON from an laravel API into an array on Ionic 3</p>
  
  <p>Here is my json :</p>
  
  <p><a href="https://i.stack.imgur.com/izRAV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/izRAV.png" alt="output of the console.log"></a></p>
  
  <pre><code> Object {id_oiseau: 1, 
      nom_commun: "Hirondelle", 
      lieu_signalement: "Foret", 
      date_signalement: "2017-05-16", 
      condition_signalement: "Aile coincee sous branche"…}
      condition_signalement:"Aile coincee sous branche"
      date_reception:"2017-05-16"
      date_renvoi:"2017-05-02"
      date_signalement:"2017-05-16"
      descriptif_etat:"Aile cassee"
      etat_actuel:"En attente de livraison"
      id_acteur:1
      id_adherent_lpo:1
      id_local_lpo:1
      id_oiseau:1
      id_oiseau_dico:1
      id_statut_oiseau:1
      image:"bird-profil.jpg"
      immatriculation:"EZ654ERRZ"
      lieu_signalement:"Foret"
      nom_codifie:"HIRON-NANT-4949845"
      nom_commun:"Hirondelle"
      pays:"France"
  </code></pre>
  
  <p>Here is the provider to receive the JSON for my Ionic app :</p>
  
  <pre><code>export class BirdService {
  
      returnedData;
      headers: any;
      options: any;
  
      constructor(public http: Http) {
          this.headers = new Headers();
          this.headers.append('Content-Type', 'application/json');
      }
  
      getRemoteData(): Observable&lt;any&gt; {
          return this.http.get('http://extranet.local/api/v1/bird/1', this.headers).map(res =&gt; res.json());
      }
  }
  </code></pre>
  
  <p>Here is the function to convert the JSON : </p>
  
  <pre><code> export class HistoryPage {
  
      constructor(public navCtrl: NavController, public serviceOne: BirdService) {}
  
      ionViewDidLoad() {
  
          this.serviceOne.getRemoteData().subscribe(
              data =&gt; {
                  let list: History[] = data;
                  console.log(data);
          });
      }
  }
  </code></pre>
  
  <p>And it doesn't work because the JSON file stay in JSON "Object {.. : .. , .. : ..}"</p>
  
  <p>I tried with parseJSON with Jquery but i had "Cannot read property 'parseJSON' of undefined"</p>
  
  <pre><code>   import { jQuery } from 'jquery';
  
  @Component({
    selector: 'page-History',
    templateUrl: 'History.html'
  })
  
  export class HistoryPage {
  
      constructor(public navCtrl: NavController, public serviceOne: BirdService) {}
  
      ionViewDidLoad() {
  
          this.serviceOne.getRemoteData().subscribe(
              data =&gt; {
                  var History = jQuery.parseJSON(data);
                  console.log(History);
          });
      }
  }
  </code></pre>
  
  <p>Also i used Angular with fromJson but Ionic can't find the name "angular" </p>
  
  <pre><code>import { Component } from '@angular/core';
  import { NavController } from 'ionic-angular';
  import { jQuery } from 'jquery';
  
  
  @Component({
    selector: 'page-History',
    templateUrl: 'History.html'
  })
  
  export class HistoryPage {
  
      constructor(public navCtrl: NavController, public serviceOne: BirdService) {}
  
      ionViewDidLoad() {
  
          this.serviceOne.getRemoteData().subscribe(
              data =&gt; {
                  var History = angular.fromJson(data);
                  console.log(History);
          });
      }
  }
  </code></pre>
  
  <p>Thanks for your help !</p>