title: Using $index with the AngularJS 'ng-options' directive?
body: <p>Say that I bind an array to a <code>select</code> tag using the following:</p>
  
  <pre><code>&lt;select ng-model="selData" ng-options="$index as d.name for d in data"&gt;
  </code></pre>
  
  <p>In this case, the associated <code>option</code> tags are assigned a sequence of index values: (0, 1, 2, ...). However, when I select something from the drop-down, the value of <code>selData</code> is getting bound to <code>undefined</code>. Should the binding actually work?</p>
  
  <p>On the other hand, say that I instead do the following:</p>
  
  <pre><code>&lt;select ng-model="selData" ng-options="d as d.name for d in data"&gt;
  </code></pre>
  
  <p>Here, the <code>option</code> tags get the same index, but the entire object is bound on change. Is it working this way by design, or this behavior simply a nice bug or side-effect of AngularJS?</p>