title: Angular 5 Service to read local .json file
body: <p>I am using Angular 5 and I've created a service using the angular-cli</p>
  
  <p>What I want to do is to create a service that reads a local json file for Angular 5.</p>
  
  <p>This is what I have ... I'm a bit stuck...</p>
  
  <pre><code>import { Injectable } from '@angular/core';
  import { HttpClientModule } from '@angular/common/http';
  
  @Injectable()
  export class AppSettingsService {
  
    constructor(private http: HttpClientModule) {
      var obj;
      this.getJSON().subscribe(data =&gt; obj=data, error =&gt; console.log(error));
    }
  
    public getJSON(): Observable&lt;any&gt; {
      return this.http.get("./assets/mydata.json")
        .map((res:any) =&gt; res.json())
        .catch((error:any) =&gt; console.log(error));
  
    }
  
  }
  </code></pre>
  
  <p>How can I get this finished?</p>