ng-repeat を使用しますが、オプション値を取得できません!
助けてください!html:
<ul ng-controller="app">
<li ng-repeat="mainlist in mainlists">
<p>{{mainlist.name}}</p>
<select ng-options="mainlist.list for mainlist.list in mainlists.list">
<option value="">{{mainlist.list.name}}</option>
</select>
</li>
</ul>
このデモ
js: {{mainlists.name}} を取得するだけで { { mainlists.list.name}}を取得しない
function app($scope) {
$scope.mainlists = [
{
"name":"main001",
"list":[
{
"no":"1",
"name":"sub1"
},{
"no":"2",
"name":"sub2"
}]
},
{
"name":"main002",
"list":[
{
"no":"2-1",
"name":"sub1"
},{
"no":"2-2",
"name":"sub2"
}]
}]
};
このデモ