Hi, Sander,
In an HTML select that is rendered as a dropdown, you are correct. Some
item must be selected in the dropdown.
However, in an HTML select that is rendered as a list (size > 1), it is
possible in pure HTML for no item to be selected. That is the scenario I
am discussing.
Example:
<select size="3"><option>Item 1<option>Item 2<option>Item 3</select>
Stephen
On 4/3/2014 11:49 AM, Sander Elias wrote:
Hi Stephen,
The option list shows the current value. If the current value is not
in the list it will be put in there.
So, whatever you will put in the ng-model will be shown. this how a
select works. There is nothing
Angular on this. It is how HTML forms work.
If it is critical to your UX, you should not use a select, but
something else (a button-bar comes to mind!)
Or put an default value in ngModel (for example the text: Select an color)
Regards
Sander
--
You received this message because you are subscribed to a topic in the
Google Groups "AngularJS" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/angular/lpShs0sItM8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
[email protected]
<mailto:[email protected]>.
To post to this group, send email to [email protected]
<mailto:[email protected]>.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.