我有下面的json文件。我想使用Angularjs ng-repeat来显示一些数据,例如,如果字段'productTypeNumber'的值等于“CREDITS”。
在SQL中,您可以创建一个查询,例如'select * from some where where where something ='aValue'
我已经在项目中尝试了“ng-repeat”项目,但我不知道如何进一步进行过滤。
{ "productOverviewInfo" : [ { "agreementName" : { "T" : "text",
"V" : "Credits 1"
},
"agreementNumber" : { "E" : "7i1li8HKJXPsuua3wVjRIGCDKF0eW4QEojlrmy3qfYI=",
"T" : "hidden"
},
"groupNumber" : { "E" : "+FxW+sUWZhz2COHKUKeUfzYdsGZHcC3SjtM1H/nK/6E=",
"T" : "text",
"V" : "1001"
},
"order" : { "T" : "short",
"V" : "1"
},
"productTypeNumber" : { "T" : "text",
"V" : "CREDITS"
}
},
{ "agreementName" : { "T" : "text",
"V" : "Loan Balance Insurance 1"
},
"agreementNumber" : { "E" : "ikUA/JZIenm8CH3Yqg1fGPGUC823misEI/leUq5WRu8=",
"T" : "hidden"
},
"groupNumber" : { "E" : "RuwzO2T3Ckx/dJAtrx8oZ32MueyWztcBIM7BLCyXoRg=",
"T" : "text",
"V" : "1001"
},
"order" : { "T" : "short",
"V" : "1"
},
"productTypeNumber" : { "T" : "text",
"V" : "LOANBALANCEINS"
}
},
{ "agreementName" : { "T" : "text",
"V" : "House Insurance 1"
},
"agreementNumber" : { "E" : "ZYiaaho+tH5l6j7rYZIizWisEu7/9zLMG/n+MYtyvN8=",
"T" : "hidden"
},
"groupNumber" : { "E" : "0tgAy2IQ2TnhVHA49R282DNTqS5dcaEVsiYZBk7Aqvw=",
"T" : "text",
"V" : "1001"
},
"order" : { "T" : "short",
"V" : "1"
},
"productTypeNumber" : { "T" : "text",
"V" : "HOUSEINS"
}
},
{ "agreementName" : { "T" : "text",
"V" : "Credits 2"
},
"agreementNumber" : { "E" : "Jb7EK6h+kh+SqK4Z2BDJ/XHl04mwCN71bI/AcWuqtrE=",
"T" : "hidden"
},
"groupNumber" : { "E" : "SziYFGSXHzE6kwaw5fwmh0hbz5hAui6ZTO7HtvKUGIU=",
"T" : "text",
"V" : "1001"
},
"order" : { "T" : "short",
"V" : "2"
},
"productTypeNumber" : { "T" : "text",
"V" : "CREDITS"
}
},
{ "agreementName" : { "T" : "text",
"V" : "Loan Balance Insurance 2"
},
"agreementNumber" : { "E" : "NrYKr+PY/6Uz5SXcfMFbs7JxP3w34O9LhQ3/wvvm9rA=",
"T" : "hidden"
},
"groupNumber" : { "E" : "hrYVzn4TrTURGbkVo+VG4tSdqo88l65NbMnvPY3aFTc=",
"T" : "text",
"V" : "1001"
},
"order" : { "T" : "short",
"V" : "2"
},
"productTypeNumber" : { "T" : "text",
"V" : "LOANBALANCEINS"
}
},
{ "agreementName" : { "T" : "text",
"V" : "987654306"
},
"groupNumber" : { "E" : "D1aSlOOBIsMlshehl4v4aJBiGWZb1Fp4/45wSLikKG4=",
"T" : "text",
"V" : "1001"
},
"order" : { "T" : "short",
"V" : "2"
},
"productTypeNumber" : { "T" : "text",
"V" : "House Insurance 2"
}
},
{ "agreementName" : { "T" : "text",
"V" : "Credits 3"
},
"agreementNumber" : { "E" : "Lw+HmRbP3nP7h+Lx3rfN+FkL5J+qNXy/+jPwARwV4uY=",
"T" : "hidden"
},
"groupNumber" : { "E" : "FOYM9Yw1HIBFyGNshOail0zDmjwtsrc6VX0al08QcRQ=",
"T" : "text",
"V" : "1001"
},
"order" : { "T" : "short",
"V" : "3"
},
"productTypeNumber" : { "T" : "text",
"V" : "CREDITS"
}
},
{ "agreementName" : { "T" : "text",
"V" : "Credits 4"
},
"agreementNumber" : { "E" : "857F3N+oA+/XoDaF8une5ujY130irRSw9Jf1mz2odMc=",
"T" : "hidden"
},
"groupNumber" : { "E" : "Ovad7odXFlAPC6j9MH0lV2y/XbUX46jPu5Of7GlEDqw=",
"T" : "text",
"V" : "1001"
},
"order" : { "T" : "short",
"V" : "4"
},
"productTypeNumber" : { "T" : "text",
"V" : "CREDITS"
}
}
] }
答案 0 :(得分:0)
你可以试试这个:
ng-repeat="info in productOverviewInfo | filter:{productTypeNumber.V: "CREDITS"}
我没有测试过 - 不确定它是否有效。