title: Angular 2 how to get key value from object arrays?
body: <p>I have <code>object array</code> : </p>
  
  <p><a href="https://i.stack.imgur.com/gcB2f.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gcB2f.png" alt="enter image description here"></a></p>
  
  <pre><code>{"-LTYJbW1B3mhrdc6C64N":{"done":0,"name":"Job2","pt":5},"-LTYJcSOUh07SQcixP4x":{"done":0,"name":"Job3","pt":5}}
  </code></pre>
  
  <p>As it seems, there is two objects with random keys (<code>--LTYJbW1B3mhrdc6C64N</code>) , I <strong>want to get these KEYS, how I can do that ?</strong></p>
  
  <p>HTML : </p>
  
  <pre><code>&lt;div class="task-block" *ngFor="let task of objectValues(team.tasks)"&gt;
   &lt;p &gt;{{task.name}}&lt;/p&gt;
   &lt;button mat-raised-button (click)="updateTask(task)"&gt;Done!&lt;/button&gt;
    &lt;i class="material-icons deletetask"&gt;close &lt;/i&gt;&lt;/div&gt;
  </code></pre>
  
  <p>TS : </p>
  
  <pre><code>objectValues(obj) { 
    if(obj){
      console.log(JSON.stringify(obj))
      return Object.values(obj || {});
    }
  
    }
  
  
  
  updateTask(task){
        console.log(task.key); //here I want to get task.key
      }
  </code></pre>