I have made the following tries and I am able to fetch the Selected Checkbox Value but Unable to Fetch the Textbox Value that has been Entered. So i am in need of some suggestions.
HTML File
<ion-row class="service" *ngFor="let singleBarberService of allBarberServices">
<ion-col col-7 padding>
<ion-checkbox value="{{singleBarberService.service_id}}" (click)="clickSelectBox(singleBarberService)"></ion-checkbox> {{singleBarberService.service_name}} <br>
</ion-col>
<ion-col col-5>
<ion-input type="number" placeholder="Amount" min="0" step="0.01" name="amountservice" #amountservice required></ion-input>
</ion-col>
</ion-row>
Note: allBarberServices
Contains the JSON Array and it Displays the APP Page has the below screenshot.
TS File:
clickSelectBox(itemKey){
const foundAt = this.selectedQuestions.indexOf(itemKey);
if (foundAt >= 0) {
this.selectedQuestions.splice(foundAt, 1);
} else {
this.selectedQuestions.push(itemKey);
}
console.log('Item Key: '+ itemKey.service_id);
console.log(this.amountservice.value); // fetch only the First Textbox Value
console.log(this.selectedQuestions); // This Displays all the Selected Checkbox Items
}