AngularJS选择选项保留选项中的空白

时间:2018-09-28 16:45:14

标签: angularjs select dropdown ng-options

我有一个下拉列表,其选项值可能包含我想保留的额外空白。但是看起来当选项被渲染时,空白被修剪掉了。

var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
    $scope.names = ["aaa    bbbb   cc", "aa d   d bb nn","xxx       zzz    yyy"];
    
});
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<div ng-app="myApp" ng-controller="myCtrl">
<p id="demo"></p>

<select id="mySelect" >
<option ng-repeat="letter in names">{{letter}}</option>
</select>


</div>

0 个答案:

没有答案