This is the html part of select
<select class="form-control w-searchbar-select" ng-model="aa" ng-init="aa='请选择设备状态'" >
<option ng-repeat="data in ProcedureList" value="{{$index}}">{{data}}</option>
</select>
The following is the equipmentProcedureList part defined
$scope.equipmentProcedureList = ["请选择设备状态", "注册", "使用中", "故障", "报废"];
The effect of the current writing method on the page is:
No items are selected in the select box and it is blank.
However, if the value="{{$index}}" in option is removed, it will be displayed normally.
Seek the guidance of the great God
The desired page effect is to select "Please select device status" by default, and the value of the remaining items is $index. Finally, ng-repeat is used to implement the above functions.
$scope.equipmentProcedureList = ["Please select device status", "Registered", "In use", "Fault", "Scrap"];
The above are the drop-down options of select, predefined.
Specify the items selected by default here
This is the HTML part
angularJS recommends using ng-options to create drop-down menus
The value of value in option is a number, and when initialized, value='Please select device status', there is no corresponding display value with this value..