title: How to display a array elements in HTML(ionic 3)
body: <p>I'm new to ionic. Actually, I'm trying to display products added to cart in cart page. I got value from Foreach method, but when I try to display, it won't show.</p>
  
  <pre><code>cartpage(){
    this.cart.cartview().then((result) =&gt; {
      this.cartdisplay = JSON.parse(JSON.stringify(result));
      this.categorydata = JSON.parse(JSON.stringify(this.cartdisplay.data));
      console.log('result11:'+JSON.stringify(this.categorydata));
  
       var arr = Object.keys(this.categorydata.items);
  
        //this.cartarray =[];
  
      arr.forEach( a =&gt;{
  
        this.cartarray['orderitem_name']= this.categorydata.items[a].orderitem_name;
        this.cartarray['orderitem_quantity']= this.categorydata.items[a].orderitem_quantity;
        console.log('cart : '+this.cartarray['orderitem_quantity']);
  
        console.log(a) //item id
        console.log(this.categorydata.items[a].cart_id) //product id
      })
      console.log(this.cartarray);
    })
  }
  </code></pre>
  
  <p>in the console log, orderitem_name and orderitem_quantity is displaying, but it does not show in the HTML page.
  This is my HTML code:</p>
  
  <pre><code>&lt;ion-card&gt;
    &lt;ion-card-header&gt;Items&lt;/ion-card-header&gt;
    &lt;!--&lt;ion-card-content &gt;Your cart is empty!&lt;/ion-card-content&gt;--&gt; 
    &lt;ion-list no-lines&gt;
      &lt;ion-item  *ngFor="let tms of cartarray;" &gt;
        &lt;ion-avatar item-left&gt;
          &lt;img src=""&gt;
        &lt;/ion-avatar&gt;
        &lt;h2&gt;&lt;b&gt;{{tms.orderitem_name}} x {{tms.orderitem_quantity}}&lt;/b&gt;&lt;/h2&gt;
        &lt;div [ngSwitch]="product?.price_discount"&gt;
          &lt;p *ngSwitchCase="true"&gt;₹ &lt;span st&gt;&lt;/span&gt; &lt;span&gt;&lt;/span&gt;&lt;/p&gt;
          &lt;p *ngSwitchDefault&gt;₹ &lt;span style="text-decoration: line-through;"&gt;&lt;/span&gt; &lt;span&gt;&lt;/span&gt;&lt;/p&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;button primary large&gt;
            &lt;ion-icon name="add" (click)="increaseQuantity(i)"&gt;&lt;/ion-icon&gt;
          &lt;/button&gt;
          &lt;button primary large&gt;
            &lt;ion-icon name="remove" (click)="decreaseQuantity(i)"&gt;&lt;/ion-icon&gt;
          &lt;/button&gt;
        &lt;/div&gt;
      &lt;/ion-item&gt;
    &lt;/ion-list&gt;
    &lt;!--&lt;ion-card-content &gt;&lt;div&gt;Total for this order is ₹ &lt;/div&gt;&lt;/ion-card-content&gt;--&gt;
  &lt;/ion-card&gt;
  </code></pre>
  
  <p>Help me to display a value in foreach loop in ionic 3</p>