<form class="col2">
<label for="filter-online">
Filter by Online
</label>
<div class="select">
<select id="filter-online" ng-model="vm.online" class="form-control" ng-options="online for online in vm.onlines">
<option value="">All</option>
</select>
</div>
</form>
<form class="col2">
<label for="filter-productType">
Filter by Product Type
</label>
<div class="select">
<select id="filter-productType" ng-model="vm.productType" class="form-control" ng-options="productType for productType in vm.productTypes">
<option value="">All</option>
</select>
</div>
</form>
<tr ng-repeat="lim in vm.stockLimits track by lim.id">
<td>{{lim.online}}</td>
<td>{{lim.producttype}}</td>
</tr>
vm.stockLimits values below:
ONLINE PRODUCT TYPE
Men Shirt
Men Shoe
Ladies Top
Kids belt
Kids
..........
..........
基于下拉(filter_online选择& filter_productType选择),需要过滤表中的数据。 是否可以在角度脚本文件中编写一个自定义过滤器javascript函数,该文件可用于基于下拉选择过滤在线&产品类型?如果你向我展示这样做的想法,那将是非常棒的。过滤器表列角度js基于下拉
全干活拨弄它的伟大工程,但productType可以为空。如果productType为空,则过滤不正确。 – user2057006
@ user2057006好吧。你可以用上面的代码来制作一个小提琴/砰砰声,指出究竟发生了什么?我会看看,并尝试在早上帮助你。此外,请标记回答接受,如果它帮助..谢谢! – tanmay
它有帮助,但productType可以在输入中为空。例如, { id:5, 在线:“儿童”, productType:'' } – user2057006