I can't get nested ng-repeat to work for a data-structure like the following:
options = [{name:"opt1", data:["a","b","c"]}, {name:"op2", data:["d","e","f"]}]
What I'm trying to accomplish is creating a select tag for each entry with options in it.
I thought that something like this should work:
<label ng-repeat="option in options">
<div>{{option.name}}</div>
<select>
<option ng-repreat="val in option.data">{{val}}</option>
</select>
</label>
but only the name is name is printed properly and only one option with no value in it is created.
Then I tried using track by $index in the inner ng-repeat:
<label ng-repeat="option in options">
<div>{{option.name}}</div>
<select>
<option ng-repreat="val in option.data track by $index">
{{option.data[$index]}}
</option>
</select>
</label>
but $index appears to be the outer $index and only counts from 0 to 1 with the given data.
What am I doing wrong?
ng-repreatshould beng-repeatselect's ng-option.<select ng-options="val for val in option.data"></select>should work, right? Because it's not^^