I am making use of the mat-autocomplete component with an input as per the examples in the docs, and I have configured the input with a placeholder and a formControlName like so:
<mat-form-field class="example-full-width">
<input type="text" placeholder="Persona*" aria-label="Number" matInput formControlName="idPersona"
[matAutocomplete]="autoPersonas">
<mat-autocomplete autoActiveFirstOption #autoPersonas="matAutocomplete"
[displayWith]="displayPersona(filteredOptionsPersonas | async)" (optionSelected)="selectedValue($event)">
<mat-option *ngFor="let option of filteredOptionsPersonas" [value]="option.idPersona">
<p>{{option.nombre}}</p>
</mat-option>
</mat-autocomplete>
</mat-form-field>
I'm also using optionSelected which emits MatAutocompleteSelectedEvent from mat-autocomplete to keep the viewvalue (option selected), the value, the formControlName and the placeholder. The problem is that I can't reach the last two (formControlName and placeholder) from the event object MatAutocompleteSelectedEvent. Is there a way to reach those properties?