我是这个JSON:
{
"world": [{
"name": {
"en": "America"
},
"type": "continent",
"children": [{
"type": "state",
"name": {
"en": "Florida"
}
}, {
"type": "state",
"name": {
"en": "Hawaii"
}
}]
}, {
"name": {
"en": "Europe"
},
"type": "continent",
"children": [
]
}]
}
我需要做两个选择。第一个包含类型"大陆"的选择,如果第一个孩子是>,则必须显示基于第一个的另一个。 0并包含状态选择。
答案 0 :(得分:2)
你可以这样做,
<select name="client" ng-model="selectedRequest.continent" ng-options="c.name.en for c in clients.world" required></select>
<select id="department" ng-model="selectedRequest.state" ng-options="d.name.en for d in selectedRequest.continent.children"></select>
修改