title: Iterate over an array of Objects and get the key Angular 2
body: <p>Hi I have a data structure as below:</p>
  
  <pre><code>list = [{id: "test", name: "name1"}, {id: "test1", name: "name2"}, ..]
  </code></pre>
  
  <p>I want to display the keys (id and name) as th in my table. Since i didnt find any buitin pipes i created a custom one.</p>
  
  <pre><code>@Pipe({name: 'keys'})
  export class KeysPipe implements PipeTransform {
    transform(value, args:string[]) : any {
      let keys = [];
      for (let key in value) {
        keys.push({key: key, value: value[key]});
      }
      return keys;
    }
  }
  </code></pre>
  
  <p>But in my html, am getting only 0, 1 , 2, ... as keys. Any idea whats happening wrong here? </p>