change variable when inputs changed in Angular

322 Views Asked by At

When numbers are entered in the price(Fiyat) fields in the picture, I want the place that says 0 TL to change. The place that says 0 TL should be the sum of the numbers step by step. How can i do that?

<td><input (keypress)="keyPressNumbersWithDecimal($event)" type="text" id="price_{{i}}" name="price"/></td>

<td colspan="3" style="color: #f87575; text-align: right; ">{{totalPrice}} TL</td>

Note : number of inputs is dynamic

enter image description here

1

There are 1 best solutions below

0
Buchi On

Instead of

<input (keypress)="keyPressNumbersWithDecimal($event)" type="text" id="price_{{i}}" name="price"/>

Try

<input [(ngModel)]="totalPrice" type="text" id="price_{{i}}" name="price"/>