How to filter (key, value) with ng-repeat in AngularJs?
问题 I am trying to do something like : <div ng-controller=\"TestCtrl\"> <div ng-repeat=\"(k,v) in items | filter:hasSecurityId\"> {{k}} {{v.pos}} </div> </div> AngularJs Part: function TestCtrl($scope) { $scope.items = { \'A2F0C7\':{\'secId\':\'12345\', \'pos\':\'a20\'}, \'C8B3D1\':{\'pos\':\'b10\'} }; $scope.hasSecurityId = function(k,v) { return v.hasOwnProperty(\'secId\'); } } But somehow, it is showing me all items. How can I filter on (key,value) ? 回答1: Angular filters can only be applied to