title: Ionic read local JSON file
body: <p>I am trying to read a local JSON file in Ionic 3. I have saved the JSON file in assets folder as csvjson.json</p>
  
  <p>I call the following function inside one of the services. </p>
  
  <p>getProducts() {
      console.log('Inside getProducts')</p>
  
  <pre><code>return this.http.get(this.apiHost)
    .map((response: Response) =&gt; {
      console.log(response);
      return response.json();
    });
  </code></pre>
  
  <p>}</p>
  
  <p>and then store the result in</p>
  
  <pre><code>myArray = this.databaseprovider.getProducts();
  console.log("Returned from getProducts:" + myArray.length);
  </code></pre>
  
  <p>However I get the output as </p>
  
  <blockquote>
    <p>Returned from getProducts:undefined</p>
  </blockquote>
  
  <p>Can you pls suggest where I am going wrong?</p>