我正在根据登录的用户过滤列表。它显示了确切的结果,但在控制台中我仍然收到错误:
Error: [filter:notarray] Expected array but received: {}
角:
<div ng-repeat="q in questions | filter: {fields: {user: user.current}}">
<!-- do something -->
</div>
user.current
$scope.user.current = fhauth.getCurrentUser().userId;
object
中的每个question array
都有一个字段数组;
fields[
{
'questionId': 1,
'user' : 'person1'
}
],
fields[
{
'questionId': 2,
'user' : 'person2'
}
]