Apparently AngularJS cannot properly construct a list of <option>
elements as a simple template in IE, so it provides the ng:Options
directive (see https://github.com/angular/angular.js/issues/235).
After looking at the source, I was able to construct the options with the desired labels, as follows (JSFiddle):
<!-- what I'd like to do -->
<select>
<option ng:repeat='key in keys' value='{{key}}'> {{lookup[key].firstName}} {{lookup[key].lastName}} </option>
</select>
<br/>
<br/>
<!-- what Angular lets me do -->
<select ng-model='key' ng:options='k as lookup[k].firstName + " " + lookup[k].lastName for k in keys'></select>
However, when I inspect the options with Firebug, I see that the value is a numeric index, not my desired key value (I was hoping the initial k
would be used as the option value).
I haven't looked deeply into the code, so don't know if there's another part of the expression that I'm missing (the regex doesn't seem to have any additional relevant keywords).
I was hoping that someone here might know this directive well enough to tell me (1) how to do it, or (2) that I'm out of luck.