PARENT COMPONENT
parent.html
<lightning-button variant="brand" label="Select" title="Select Family"
data-id={fam.accountId} onclick={handleSelectFamily}
class="slds-m-left_x-small"></lightning-button>
parent.Js
handleSelectFamily(event)
{
this.accountId = event.currentTarget.dataset.id;
alert('if');
this.template.querySelector("c-transaction-Invoice-Payment").handlePayments();
alert('end');
}
CHILD COMPONENT
TransactionInvoicePayment.Js
@api handlePayments() {
console.log('IN handlePayments');
}
Trying to pass and trigger the child method from the parent LWC, but it doesn't trigger. Tried by doing alert only the first alert is prompting, Checked in console log too no error occurs.
Can you please help me with what I am missing here. Thanks