title: how to access key/value pairs from json() object?
body: <p>I'm calling an external service and I get the returned domain object like this:</p>
  
  <pre><code>var domainObject = responseObject.json();
  </code></pre>
  
  <p>This converts the response object into a js object. I can then easily access a property on this object like this</p>
  
  <pre><code>var users = domainObject.Users
  </code></pre>
  
  <p>Users is a collection of key/value pairs like this:</p>
  
  <pre><code>1: "Bob Smith"
  2: "Jane Doe"
  3: "Bill Jones"
  </code></pre>
  
  <p>But CDT shows users as Object type and users[0] returns undefined. So how can I get a handle to the first item in the collection? I'm assuming that some type of type cast is needed but not sure how I should go about doing this</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Here is one way I could access the values:</p>
  
  <pre><code>//get first user key
  Object.keys(responseObject.json().Users)[0]
  
  //get first user value
  Object.values(responseObject.json().Users)[0]
  </code></pre>
  
  <p>But I need to databind through ng2 so I was hoping for a simpler way like this:</p>
  
  <pre><code>&lt;div&gt;
      &lt;div *ngFor="let user of users"&gt;
          User Name: {{user.value}}
          &lt;br&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Maybe I should just create a conversion function in my ng2 component which converts the object into what I need before setting the databinding variable?</p>