I am working with AngularJS and X-editable from past few weeks and one thing which is bothering me is that select option provides a empty option as first child.
Here's the HTML
<span editable-select="curuser.roles" e-name="roles" e-ng-options="role as role.name for role in roles">
{{ showRoles() }}
</span>
Here is output HTML :
<select name="roles" ng-options="role as role.name for role in roles">
<option value="?" selected="selected"></option>
<option value="0">Admin</option>
<option value="1">Company</option>
<option value="2">Manager</option>
</select>
What do I need to do to get rid of this empty option?
Here is working JSFiddle
ng-model
on your select and initialize it onload:$scope.model = roles[0];
- AlwaysALearner