我有资源
$scope.list = [
{ listId:1, name: "Test1" },
{ listId:2, name: "Test 2" }
];
我还有一个引用第一个listId
$scope.includedList = [
{
includedListId:1,
title: "Title 1",
listId:1
}];
我有一个带有重复的显示,我想检查列表项是否包含在第二个资源中。
< a ng-repeat="item in list"
ng-class="selected if item is included in includedList"
>
答案 0 :(得分:0)
写一个函数
$scope.isIncluded = function ()
然后
&LT; a ng-repeat =“列表中的项目”ng-class =“{selected:isIncluded(item,includedList)}”&gt;
我不明白包含的确切逻辑,所以我将函数留空