如何在AngularJs中使用ng-repeat過(guò)濾(鍵,值)?我想做的事情如下:<div ng-controller="TestCtrl">
<div ng-repeat="(k,v) in items | filter:hasSecurityId">
{{k}} {{v.pos}} </div></div>AngularJs部分:function TestCtrl($scope) {
$scope.items = {
'A2F0C7':{'secId':'12345', 'pos':'a20'},
'C8B3D1':{'pos':'b10'}
};
$scope.hasSecurityId = function(k,v)
{
return v.hasOwnProperty('secId');
}}但不知何故,它向我展示了所有項(xiàng)目。如何過(guò)濾(鍵,值)?
如何在AngularJs中使用ng-repeat過(guò)濾(鍵,值)?
當(dāng)年話下
2019-08-12 16:43:54