have only one value for selection (in 98% cases) with label “Main Office”. In that situation I plan to select that field automatically when that page is loaded to avoid user difficulty.
Please suggest a method …
You’ll need to set a value in your module code, e.g. data: { zonaloffice: "My Default value" }, then your select component would have that option selected by default – assuming the value matches the value of an ion-option
If I understand the question properly, you want to select the option if it contains the option “Main Office”.
Assuming that this requirement is always static, you can set it as selected with and if statement using [selected]="zonaloffice.zonal_name_eng == 'Main Office'". Either using the zonaloffice.zonal_name_eng or zonaloffice.zonal_id, I suggest using the id if you know which one its going to be, if not you can use the name like so:
I have one more condition , if there is only one value in option that is “Main Office” then select it . If more than one select option no need to select. In your case that may select in all cases…
Please consider that case and advise