Let’s say I have an employee structure with a 1-character field for “maritalStatus”. They have the following meanings:
this.maritalStatuses = [
{"code": "M", "description": "Married"},
{"code": "S", "description": "Single"},
{"code": "D", "description": "Divorced"},
{"code": "W", "description": "Widowed"}
]
Simple binding with {{employee.maritalStatus}} would show them “M”, but I want them to see “Married”.
So I tried using an ion-select.
<ion-select [(ngModel)]="employee.maritalStatus">
<ion-option *ngFor="let maritalStatus of maritalStatuses" value={{maritalStatus.code}}>{{maritalStatus.description}}</ion-option>
</ion-select>
Which works great, but it adds all the “field selection” decorators - the dropdown arrow, the list of maritalStatuses to choose from… I don’t want them changing this field. I don’t want any of the other ion-option values showing. I just want to translate “M” to “Married”, “D” to “Divorced” and so on.
Is there a parameter to either ion-select or ion-option that does this?