I have my group using ng-options, which looks like
<select ng-model="selected" ng-options="d.title group by d.group for d in data"></select>
Here are my details
$scope.data = [ { group:"", title:"No GroupA" }, { group:"Group_1", title:"1" }, { group:"", title:"No GroupB" }, { group:"Group_2", title:"2" }, { group:"", title:"No GroupC" } ];
the problem is that this creates an optgroup at the bottom of this selection menu, and not in the same order as in my data list.
No GroupA No GroupB No GroupC [Group_1] 1 [Group_2] 2
I want to create:
No GroupA [Group_1] 1 No GroupB [Group_2] 2 No GroupC
Here is the fiddle
Thanks!
source share