我只是询问了从键/值映射而不是数组生成选择:AngularJS select box generated from object
现在一切正常:http: //jsfiddle.net/UPWKe/1/
<select ng-model="current.addressCode" ng-options="value.code as value.name for (key, value) in student.address | orderBy: 'code'"</select>
...和js ...
$scope.student = {
address: {
select: {
code: "0",
name: "Select proof of address"
},
letter: {
code: "1",
name: "Letter"
},
photograph: {
code: "3",
name: "Photograph"
}
},
但唯一缺少的是如何订购所选项目。
如何在从 angularjs 中的键/值映射生成的选择框中订购选择项目?