我有成群结队的物品。
的WebAPI:
Add(new Name { group = "de", fname = "Hans" }); //germany
Add(new Name { group = "de", fname = "Peter" }); //germany
Add(new Name { group = "us", fname = "John" }); //usa
Add(new Name { group = "jpm", fname = "Chen" }); //japan
服务:
$scope.nameslist = personService.name.query();
名称显示在表格中:
<tr ng-repeat="item in filteredNames = (nameslist | filter:formGroup)">
<td>{{ item.fname }}</td>
</tr>
搜索表单与表格的视图相同。
<div class="form-group form-group-sm">
<label class="col-sm-2 control-label">DE</label>
<div class="col-sm-1">
<input type="radio" class="radio" name="checked" ng-click="chosenGroup()" ng-model="formGroup.checked" value="de" />
</div>
<label class="col-sm-2 control-label">US</label>
<div class="col-sm-1">
<input type="radio" class="radio" name="checked" ng-click="chosenGroup()" ng-model="formGroup.checked" value="us" />
</div>
<label class="col-sm-2 control-label">JPN</label>
<div class="col-sm-1">
<input type="radio" class="radio" name="checked" ng-click="chosenGroup()" ng-model="formGroup.checked" value="jpn" />
</div>
</div>
如何为相应的组定义过滤器?