title: How to loop through array of objects in angular 6?
body: <p>I am very new to angular and I am assigned to a task where I want to get data from an API and iterate and display it in a chart. My angular version is 6.</p>
  <p>This is the response JSON format,  It is a list of objects-</p>
  <pre><code>[
      {
          &quot;counts&quot;: 0,
          &quot;time&quot;: &quot;00:00:00&quot;
      },
      {
          &quot;counts&quot;: 0,
          &quot;time&quot;: &quot;01:00:00&quot;
      },
      {
          &quot;time&quot;: &quot;02:00:00&quot;,
          &quot;counts&quot;: 1
      },
      {
          &quot;counts&quot;: 7,
          &quot;time&quot;: &quot;03:00:00&quot;
      }
  ]
  </code></pre>
  <p>To fetch that</p>
  <pre><code> data : [];
  
  this.service.getPaymentDistributionData()
      .subscribe((res) =&gt; {
        console.log(res)
      })
  </code></pre>
  <p>How can I get each count and time and print?</p>
  <p>Thanks,</p>