私のJSONデータは次のようなものです: records.json
[
{
"id":"1",
"name":"Report1",
"category":"A"
},
{
"id":"2",
"name":"Report2",
"category":"A"
},
{
"id":"3",
"name":"Report3",
"category":"B"
},
{
"id":"4",
"name":"Report4",
"category":"C"
}
]
HTMLページは次のようになります:
<input ng-model="query" />
<li ng-repeat="record in records | filter:query" />
このコードは、クエリに従ってレコードのリストを提供しますが、カテゴリ A のみを持つレコードのみが必要です。