【发布时间】:2015-12-27 09:31:39
【问题描述】:
我有一个对象数组matchedProfiles,我正在尝试按其中的属性值对这些对象进行排序。
matched profiles = [
{
common: Array[1],
match: 8.333333333333329,
score1: Array[1],
score2: Array[1],
user1ID: "1116145178404907",
user2ID: "1710007182568600"
},
{
common: Array[1],
match: 25,
score1: Array[1],
score2: Array[1],
user1ID: "170401213316838",
user2ID: "1710007182568600"
}
]
我试图订购这个数组
var sortedMP = $filter('orderBy')(matchedProfiles, match);
但我在控制台日志中遇到错误
Uncaught ReferenceError: match is not defined
【问题讨论】:
标签: arrays angularjs javascript-objects angularjs-filter