0
<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 ?

lin
  • 17,956
  • 4
  • 59
  • 83
Amit Jain
  • 129
  • 1
  • 9
  • Check [this](http://stackoverflow.com/questions/20738953/angular-js-remove-blank-option-from-select-option). You can set in the controller as `$scope.form.priority = $scope.leadPriority[0].id;` – Arulkumar Jun 10 '15 at 08:20

3 Answers3

1

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>
1

You can set in the controller as,

$scope.form.priority = $scope.leadPriority[0].id;
Arulkumar
  • 12,966
  • 14
  • 47
  • 68
0

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.

Community
  • 1
  • 1
tech_ank
  • 59
  • 3