I have a mat-select dropdown, here I am looping through my frequencyArr object.
In ts
frequencyArr = [
{key : "Once daily", abbriviation : '0-0-1'},
{key : "Twice daily", abbriviation : '1-0-1'},
{key : "Thrice daily", abbriviation : '1-1-1'},
{key : "Four times a day", abbriviation : '1-1-1-1'}
]
In html
<mat-select placeholder="frequency" formControlName="frequency" required>
<mat-option *ngFor="let frequency of frequencyArr" [value]="frequency.abbriviation">
<span>{{frequency.key }} : {{ frequency.abbriviation}}</span>
</mat-option>
</mat-select>
What I am trying to do is when open the dialog it will show object key : object value-
<span>{{frequency.key }} : {{ frequency.abbriviation}}</span>
This is fine, but when I select the option it should show only frequency.key into selected field which is not happening.
I tried googling but did not find anything for this case. Any help is appreciated.