title: Using HttpClient to make get requests
body: <p>I have written the following code to get the dummy data <a href="https://jsonplaceholder.typicode.com/posts" rel="nofollow noreferrer">here</a>:</p>
  <pre class="lang-ts prettyprint-override"><code>export class AppComponent {
      
    jsonPosts: any = [];
  
    constructor(private httpClient: HttpClient) { }
  
    OnInit() {
      this.getJsonPosts();
    }
  
    getJsonPosts(): any {
      return this.httpClient.get(&quot;https://jsonplaceholder.typicode.com/posts&quot;)
        .subscribe(response =&gt; {
          console.log(response);
          this.jsonPosts = response;
        });
    }
  </code></pre>
  <p>I have also written the following code to display them in my HTML template:</p>
  <pre class="lang-html prettyprint-override"><code>  &lt;ul *ngFor=&quot;let i of jsonPosts&quot;&gt;
      &lt;li&gt;{{i.userId}}&lt;/li&gt;
      &lt;li&gt;{{i.id}}&lt;/li&gt;
      &lt;li&gt;{{i.title}}&lt;/li&gt;
      &lt;li&gt;{{i.body}}&lt;/li&gt;
    &lt;/ul&gt;
  </code></pre>
  <p>However, there is no network activity at all, and thus nothing shows...</p>
  <p>What am I doing wrong here?</p>