我一直在尝试使用ng-options
按数组中项目的值按字母顺序排序的选择中显示字体数组。
HTML
<select ng-options="font for font in webfonts | orderBy:'font'" name="fonts">
<option value="">Choose a font</option>
</select>
JS
$scope.webfonts = [
'Abel', 'Crafty Girls' , 'Lato' , 'Average',
'Corben', 'Quicksand', ... ];
我已经尝试更改 inorderBy
和其他内容的值。我已经阅读了文档和所有评论。
我错过了什么?这应该只适用于对象吗?