I have a JSON I get from API as :

```
 $scope.data = [{
        "primary": "white",
        "sub": ["white 1", "white 2", "white 3"]

    },{
        "primary": "black",
       "sub": ["black 1", "black 2", "black 3"]

    }];

```

I want to group by primary and selectable values are Array sub

like: 

```
**White**
   white 1
   white 2
   white 3
**Black**
   Black 1
   Black 2
   Black 3

```

I am able to group by primary key but I cannot get inner values. Here's what I have:

```
<div ng-controller="myCtrl">
    <select
        ng-model="myOption"
        ng-options="val.primary group by value.primary for value in data">

    </select>
    <div>
        ng-model value: {{myOption}}
    </div>
</div>

```

(here is my fiddle: <http://jsfiddle.net/jm6of9bu/648/>)