In my form, users input number values which I need to send to my ts file for multiplication when a button is clicked. View screenshot example
Below are the code snippets:
calculate(value0,value1){
this.bindData(value0,value1);
}
bindData(a,b){
this.state=true;
this.cshDvdnd=a*b;
this.complete.emit(this.cshDvdnd);
}
<label for="basic-url" class="form-label">Number of Shares:</label>
<div class="input-group">
<span class="input-group-addon" id="numShares"></span>
<input type="number" id="value0" name="value0" #value0 class="form-control" placeholder="Enter Total Number of Shares Owned ..." aria-describedby="numShares">
</div>
<br>
<div *ngIf="buttonNumber==0">
<label for="basic-url" class="form-label">Cash Dividend:</label>
<div class="input-group">
<input type="number" id="value1" name="value1" #value1 class="form-control" placeholder="Net Amount per Share to be Distributed to Shareholders (₺) ..." aria-describedby="basic-addon2">
<span class="input-group-addon" id="basic-addon2"></span>
</div>
</div>
<button class="btn btn-primary" (click)="calculate(value0,value1)">Calculate</button>
How can I correctly multiply the input values of value1 and value2 from the HTML form? My bindData function is not functioning as expected.
Here is the webpage I am working on: