This is my html: <form name="yourForm"> <table> <tr *ngFor="let item of items"> <td>{{item[1]}} </td> <td>{{item[0]}} </td> <td>{{item[2]}}</td> </tr> </table> </form>
This is in my controller: export class ShoppingCartComponent implements OnInit { items = []; onSubmit(quantity, product_name, product_price){ localStorage.setItem('items', JSON.stringify(quantity, product_name, product_price)); this.items.push( String(quantity), product_name, product_price ); } } It is rendered as follows: <table> <tr> <td>quantity</td> <td></td> <td></td> </tr> <tr> <td>product_name</td> <td></td> <td></td> <tr> <td>product_price</td> <td></td> <td></td> </tr> </tr> </table> My desired rendering is: <table> <tr> <td>quantity</td> <td>product_name</td> <td>product_price</td> </tr> </table> -- You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group. To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/angular/0ae7fa0e-86a7-4ae0-884c-50e2988d0534o%40googlegroups.com.