定义对集合进行过滤的过滤器
1)定义
var md = angular.module(moduleName,['ng.service']);
md.filter('propertyLikeValueFilter2',function () {
return function (list,property,value) {
return _.filter(list,function (item) {
return item[property]===value;
});
};
});
2)页面具体使用
<div ng-repeat="plan in riskGroup.planInfoList| propertyLikeValueFilter:'planName':'意外伤害' "></div>