I have a drpdown list. In my html I have this:
<select id="universitySel" ng-model="universityValue" ng-options="university._id for university in universities">
<option value="-1">Choose university</option>
</select>
I bind this dropdown from my collection. I want to show optional text as first element as you see above. First element is always empty. How do I do this?
Set the value
to an empty string ""
:
<option value="">Choose university</option>
(from Angular's documentation:)
Optionally, a single hard-coded
<option>
element, with the value set to an empty string, can be nested into the element. This element will then represent the null or "not selected" option.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments