Reputation: 129
<select ng-model="form.priority" ng-options="priority.id as priority.value for priority in leadPriority"></select>
It is showing blank option by default. How can remove it ?
Upvotes: 0
Views: 541
Reputation: 57
You can use ui-select which is more powerful version of select. You can find sample code for it here. You will need to include the js and css file from their library here.
Upvotes: 0
Reputation: 13237
You can set in the controller as,
$scope.form.priority = $scope.leadPriority[0].id;
Upvotes: 1
Reputation: 121
Use ng-init in options eg.
<select ng-model="form.priority" ng-options="priority.id as priority.value for priority in leadPriority" ng-init="form.priority = leadPriority[0].id"></select>
Upvotes: 1