title: Angular 4 - Http to HttpClient - property 'someproperty' does not exist on type Object
body: <p>I am trying to change an existing app from using <code>Http</code> to using <code>HttpClient</code>, however i have an error.</p>
  
  <p>So in my service now you can see the new code vs the old code that's been commented out:</p>
  
  <pre><code>constructor(
          // private http: Http
          private http: HttpClient
      ) { }
  
      getSidebar() {
          // return this.http.get('http://localhost:3000/sidebar/edit-sidebar')
          //     .map(res =&gt; res.json());
          return this.http.get('http://localhost:3000/sidebar/edit-sidebar');
      }
  </code></pre>
  
  <p>And in my <code>page.component.ts</code> I have this</p>
  
  <pre><code>this.sidebarService.getSidebar().subscribe(sidebar =&gt; {
                          this.sidebar = sidebar.content; // this does not work now
                      });
  </code></pre>
  
  <p>However for the line above which I commented on I get this error now:</p>
  
  <pre><code>Property 'content'
   does not exist on type 'Object'.
  </code></pre>
  
  <p>However if I <code>console.log(sidebar)</code> I get the following:</p>
  
  <pre><code>{_id: "59dde326c7590a27a033fdec", content: "&lt;h1&gt;sidebar here&lt;/h1&gt;"}
  </code></pre>
  
  <p>So what's the issue?</p>
  
  <p>Once again, <code>Http</code> works but <code>HttpClient</code> does not.</p>