Angularjs: ng-options: How to order options with group and non-group

蓝咒 提交于 2019-12-01 18:49:46

As far as I know, you can't have a mixed select - options within and without groups.

You could create a generic group for these options:

<select ng-model="selected" 
        ng-options="d.title group by (d.group ==='' ? 'No_Group' : d.group) for d in data">
</select>

Here is your updated fiddle.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!