JSON monthA:
[
[
{
"monthNumber": "8",
"monthName": "August"
},
{
"monthNumber": "9",
"monthName": "Septemeber"
},
{
"monthNumber": "10",
"monthName": "October"
},
{
"monthNumber": "11",
"monthName": "November"
},
{
"monthNumber": "12",
"monthName": "December"
},
{
"monthNumber": "1",
"monthName": "January"
},
{
"monthNumber": "2",
"monthName": "February"
}
],
]
HTML部分:
<td ng-repeat="ap in monthA" style="width:100px;" align="center" >
<select ng-model="rishi_Testing" ng-options="value.monthNumber as value.monthName for value in ap track by value.monthNumber">
<option value=""></option>
</select>
</td>
我正在使用上面写的代码使用ng-options创建一个下拉列表。但选项没有被选中。虽然我能够点击选项,但它们没有被填充为选定的值。我怀疑这是因为重复的ng模型,因此我试图创建动态ng模型? 帮我? 启发我?