attendees.component.html (Parent)
<app-add-guest (guestUserChange)="addGuest($event)"></app-add-guest>
add-guest.component.html (Child)
<form [formGroup]="form">
<ion-row>
<ion-col>
<ion-item>
<ion-label position="stacked" color="light">Guest name</ion-label
>
<ion-input // this input here
formControlName="guestName"
color="light"
type="text"
placeholder="Guest name"
>
</ion-input>
</ion-item>
</ion-col>
</ion-row>
</form>
I would like to know how I can access the ion-input
element from the parent component. This is necessary because I need to set focus on that input element within the parent component.
While there are many examples of accessing child component methods using @ViewChild
, I have not found a solution specific to my scenario described above.