How to change a variable value by 10 which is defined in parent component and accessed in child component using button?
That structure for displaying the data is not too good, and the scenario is somewhat sketchy, but if you're not going to change things atm, here you are:
add click functions to buttons:
<button (click)="incrementJack()">Send Money To Jack</button>
<button (click)="incrementJill()">Send Money To Jill</button>
define them in parent ts:
incrementJack(){
this.data.Money1 += 10;
}
incrementJill(){
let amount = parseInt(this.data.Money2) + 10;
this.data.Money2 = amount.toString();
}
Note that the money1 is number and money2 is a string, so this cod is keeping their types.