我有这样的json结构:
function SetHeight() {
var left = $(".col-left").css("height");
var right = $(".row3").css("height");
var result = parseInt(left) - parseInt(right);
$(".scroll").css("height", result);
}
$(window).resize(function() {
SetHeight();
});
SetHeight(); // Call once to start off with
现在我在ID列表上有1 ng重复循环循环(例如:101,102),因此我想按特定Id填充下拉列表。例如,对于Id 101,我想填充粉红色,黑色和102 i我希望在我的下拉列表中填写红色,黄色,并且我想完全忽略,但我不知道如何实现这一点。
码
101 :
"List": [
{
"Name": "Pink"
},
{
"Name": "Black"
}
]
102 :
"List": [
{
"Name": "Red"
},
{
"Name": "Yellow"
}
]
$scope.Ids = [101,102,103,104];
答案 0 :(得分:1)
<div ng-repeat="level1 in Ids">
<select ng-model="color" ng-options="level2 for level2 in level1.List">
</select>
</div>
您不需要option
代码!
答案 1 :(得分:1)
假设下拉地图存储在对象中:$scope.map
:
<div ng-repeat="id in Ids">
<select ng-model="color" ng-options="opt.name for opt in map[id].list"></select>
</div>