我试图为多个属性设置过滤器动态。 这是过滤行:
<div class="" ng-repeat="selectedCard in Cards | filter:{property:filterValue}">
我得到了var&#39;属性&#39;和var&#39; filterValue&#39;从这个:
<li><a type="button" ng-click="filterValue = 'adventeg' ;property = 'Type'">adventeg</a></li>
或从这一行:
<a type="button" ng-click="search=!search;property='Name'" ng-show="!search" class="nav-hover" title="s" data-toggle="tooltip" data-placement="bottom" tooltip>
<span class="glyphicon glyphicon-search" aria-hidden="true"></span>
</a>
<form class="navbar-form navbar-left" ng-show="search" role="search">
<div class="form-group">
<input type="text" class="form-control" placeholder="Search" ng-model="filterValue">
</div>
<button type="submit" class="btn btn-default" ng-click="search=!search"><span class="glyphicon glyphicon-search" aria-hidden="true"></span></button>
</form>
出于某种原因,var&#39;属性&#39;不适用于过滤器细分市场。我已经手动检查过滤器是否在没有var&#39;属性的情况下工作,并且确实如此,为什么使用var它没有&#39;