In angular material, autocomplete feature mat-option will have same entries on "value" field and text within.
<mat-form-field fxFlex="50">
<input type="text" placeholder="{{label.addUser.formLabels.role}}" matInput [matAutocomplete]="role" formControlName="roleId">
<mat-autocomplete #role="matAutocomplete" autoActiveFirstOption>
<mat-option *ngFor="let option of roleListFilter | async" value="{{option.roleId}}" >
<span>{{option.roleName}}</span>
</mat-option>
</mat-autocomplete>
</mat-form-field>
and I get the output as shown in the following question..
How can I get selected item value in Angular 2 Material Autocomplete
I want to display selected string in the text box and set roleId in value field at the same time.. Is this achievable?