0

I am creating a web app in which i am updating my records with dropdownlist

i am fetching the records with angularjs controller but unfortunately one blank line is being added in my dropdownlist at the begining of my dropdownlist

<select ng-model="mdupm" ng-options="o.empname as o.empname for o in getpm" class="form-control"></select>

this is how my dropdownlist look like

what i need to do here, to remove an blank line

2 Answers2

0

Add <option value="" style="display: none"></option> as a filler

<select ng-model="mdupm" ng-options="o.empname as o.empname for o in getpm" ng-change="(o)" class="form-control">
  <option value="" style="display: none"></option>
</select>
Rai Vu
  • 1,595
  • 1
  • 20
  • 30
0

Just add this <option value="" ng-show="false"></option> in select. You commented "space has been removed but still dropddown list is blank". Is there anything else?

<select ng-model="mdupm" ng-options="o.empname as o.empname for o in getpm" class="form-control" >
 <option value="" ng-show="false"></option>