I have a select html like this:
In my case I'm using the same markup for editing an existing entity, or creating a brand new one (so far anyway).
I want to display a default-value that is "selected" in the select-elements when in creationMode, while displaying the values form the backend in editMode.
My solution is:
for the regular available options I'm using a sortedProps Array to provide option choices. But that's not the important part here.
What did the trick for me is setting value="undefined" to let the angular-model-binding (?) select this option automatically when in creationMode. Not sure if its a hack, but does exactly what i want. No addtionally typeScript necessary.
Additionally, sepcifing hidden makes sure the option in my case is not selectable, while required makes sure the form is invalid unless something gets selected there.