有人可以帮助我构建 angular js customfilter。
我已经从记录(Json 数据)中构建了两个动态过滤器(品牌和商家)来过滤带有多个复选框的记录。
现在我需要根据选中的复选框过滤记录。最初应取消选中所有复选框并显示所有记录。
根据选择的过滤器,应该选择记录。
我的 json 数据是
$scope.records = [
{
"MerchantName": "Fashion and You",
"BrandList": " Nike, Fila",
"Description": "Fashion and You Store"
},
{
"MerchantName": "Fashion and You",
"BrandList": " Levis, Fasttrack, Fila",
"Description": "Fashion and You Store"
},
{
"MerchantName": "ebay",
"BrandList": "Nokia,HTC,Samsung",
"Description": "Ebay Store"
},
{
"MerchantName": "amazon",
"BrandList": "Apple,Dell,Samsung",
"Description": "amazon Store"
},
{
"MerchantName": "amazon",
"BrandList": " pepe jeans, peter england, red tape",
"Description": "amazon Store"
}];
html是
<div ng-repeat="record in records">
{{record.Description}}
</div>
这里是fiidle:http: //jsfiddle.net/Hp4W7/106/
提前致谢。