Ion-input getInputElement example

<ion-input [value]="paymentLink" readonly #paymentLinkInput></ion-input>
<ion-icon name="copy-outline" slot="start" color="medium" (click)="copyPaymentLink(paymentLinkInput)"></ion-icon>

Note that “#paymentLinkInput” should not have the same name as [value]=”paymentLink“.

copyPaymentLink(paymentLinkInput) {
  paymentLinkInput.getInputElement().then(data => {
    console.log(data);
  });
}

Leave a Comment