我有一个下拉在我angular.js web应用程序,如:排序不工作的下拉菜单
<select ng-model="script"
ng-options="s as s[1].shortDescription for s in objs | orderBy:'toString()'"
ng-change="updateParam()">
</select>
其中数组中的对象是
["test1", {shortDescription: "first test", longDescription: "AAAAAAAA"}]
我想shortDescription
排序类型每个条目的属性。问题在于排序不起作用。
UPDATE1
的样本数据
["test1", {shortDescription: "first test", longDescription: "AAAAAAAA"}]
["test2", {shortDescription: "2nd test", longDescription: "BBBB"}]
["test3", {shortDescription: "3rd test", longDescription: "CCCC"}]
ng选项中的数组索引看起来很可疑。 OrderBy后面应该跟着属性名称。 –