Angularjs Select handling of blank items by dynamically loading option && different options for selecting select
When you implement a drop-down box with select by dynamically loading option, when the "select" Default Display box is not set, the white key appears, and the first display is blank, and there is no option in the display, where you need to display the settings default options
<select class= "" ng-init= "" ng-model= "Condition.usetime"
Ng-options= "Usetime.value as Usetime.name for Usetimein usetimelist" ng-change= "Setmark ()" > </select>
var status = require ("./status");
$scope. usetimelist= status.usetimelist;
$scope. condition= { usetime: $scope. Usetimelist[0].value };
Setmark () is used to determine which option is selected, and then to make the appropriate action
function Setmark () { if ($scope. condition.usetime== ' 0 ') { $scope. setusetime=0; } else if ($scope. condition.usetime== ' 1 ') { $scope. setusetime=1; } }
Reference & Thanks: 72629638
Angularjs Select handles a blank item by dynamically loading option-