title: Angular passing object as value in ng-repeat (instead ng-options)
body: <p>I got curious problem: I'd like to pass option <code>ng-value</code> as an reference to object so <code>ng-model="vm.selectedItem"</code> will keep whole current option. I noticed that <code>ng-options</code> creates value like: <code>value:object:309</code>. In <code>ng-options</code> directive this behavior works, but unfortunately I cannot use it with <code>group by</code>. It just didn't work in my case :-/</p>
  
  <pre><code>vm.items = {
      label: 'Group 1',
      items: [{
              id: 1,
              name: 'Item 1'
      },
      {
              id: 2,
              name: 'Item 2'
      }]
  }
  
  &lt;select ng-model="vm.selectedItem" ng-change="vm.getSomeData"&gt;
      &lt;optgroup ng-repeat="group in vm.items" label="{{group.label}}"&gt;
          &lt;option ng-value="?????" ng-repeat="item in group.items track by item.id"&gt;{{item.name}}&lt;/option&gt;
      &lt;/optgroup&gt; 
  &lt;/select&gt;
  </code></pre>