通过布尔属性用“ track by”过滤Angular 1.2 ng-repeat
我正在尝试根据布尔属性的值过滤一些列表项,但是无论我做什么,总会显示整个列表。我尝试过的一些东西已经坏掉了,什么也没显示,但这既不存在也不存在。我无法按需进行过滤: $scope.attendees = [ {"firstname":"Steve", "lastname":"Jobs", "arrived":true, "id":1} ,{"firstname":"Michelle", "lastname":"Jobs", "arrived":false, "id":2} ,{"firstname":"Adam", "lastname":"Smith", "arrived":true, "id":3} ,{"firstname":"Megan", "lastname":"Smith", "arrived":false, "id":4} ,{"firstname":"Dylan", "lastname":"Smith", "arrived":false, "id":5} ,{"firstname":"Ethan", "lastname":"Smith", "arrived":false, "id":6} ]; 使用以下ng-repeat过滤: <ul> <li ng-repeat="person in attendees track by person.id | filter:arrived:'false'"> {{person.lastname}}, {{person.firstname}} </li> </ul> 我觉得我已经尝试了所有可以找到引用的排列,其中大部分来自各种StackOverflow搜索结果: filter:'arrived' filter:arrived filter:'person.arrived' filter:person.arrived filter:{arrived:true} …