Clone Table ROw on Button Click Angular 4

Swappy_Gaj
Posted by Swappy_Gaj under Angular category on | Points: 40 | Views : 235
HTML:
<tbody >
<tr class="danger" *ngFor="let item of items">
<td><button ion-button (click)="AddNewOrder()">+</button></td>
....
</tbody>

component.ts FILE:
AddNewOrder()
{
var obj = {
"itemname": "",
"price": 0
};
this.items.push(Array.from(Object.keys(obj), k=>obj[k]));
}
}

Comments or Responses

Login to post response