title: *ngFor Object in template Ionic 2
body: <p>I have object:</p>
  
  <pre class="lang-ts prettyprint-override"><code>messages = [{
      'One' : [
          {'id' : 1},
          {'id' : 2},
      ],
      'Two' : [
          {'id' : 1},
          {'id' : 2},
      ]
  }] ;
  </code></pre>
  
  <p>I have tried the below code but did't run please tell me where i am doing wrong. </p>
  
  <pre class="lang-ts prettyprint-override"><code>&lt;div *ngFor="let message of messages"&gt;
      &lt;div&gt;KEY&lt;/div&gt;
      &lt;div *ngFor="let value of message"&gt;VALUE&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>In code i need show KEY and VALUE </p>
  
  <p><strong>My Solution</strong></p>
  
  <p>In component:</p>
  
  <pre class="lang-ts prettyprint-override"><code>this.messages = data['messages'] ;
  this.keys = Object.keys(data['messages']);
  </code></pre>
  
  <p>In view:</p>
  
  <pre class="lang-ts prettyprint-override"><code>&lt;div *ngFor="let key of keys"&gt;
      &lt;div&gt;{{key}}&lt;/div&gt;
      &lt;div *ngFor="let message of messages[key]"&gt;{{message['id']}}&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>