Below one is just sample. I need to multiple calculations dynamically.
Total value is not updating if I change values in units/price text boxes. How can I calculate using ngModel? Should we use valueChange event? Angular 4 don't update automatically?
JSON:
items:[{units:10;price:20, total:0},
{units:20;price:23, total:0}]
Controller:
pageLoad(){
for(var i=0; i<items.length; i++){
items[i].total = items[i].units*items[i].price
}
}
HTML:
<div *ngFor="let item of items; let i=index">
<kendo-numerictextbox [(ngModel)]="item.units" />
<kendo-numerictextbox [(ngModel)]="item.price" />
<kendo-numerictextbox [readOnly]="true" [(ngModel)]="item.total" />
</div>