View By :
<input type="checkbox" name="filter" />All
<input type="checkbox" name="filter" />name
<input type="checkbox" name="filter" />type
<span class="displayphones">{{ phone | filter:? }}</span>
这里我有3个复选框,默认情况下它必须显示所有。同时选择复选框,它如何使用角度过滤器基于复选框值过滤文本?
将显示相应的结果,但我不知道如何将复选框值传递给过滤器,而不必重复NG-模型这样
View By :
<input type="checkbox" name="filter" ng-model="all" />All
<input type="checkbox" name="filter" ng-model="name" />name
<input type="checkbox" name="filter" ng-model="type" />type
<span class="displayphones">{{ phone | filter:all:name:type }}</span>
是有可能做到这一点在其他一些办法???
为什么3 ng模型有问题?通常,在Angular中,每个表单元素都有自己的ng模型。 –
实际上有3 ng模型不是我的问题。我想将所有的ng-model值作为一个数组传递。 –