Angularjs 角度JS-基于复选框组(和和或条件)的过滤

Angularjs 角度JS-基于复选框组(和和或条件)的过滤,angularjs,angularjs-directive,angular-ui,Angularjs,Angularjs Directive,Angular Ui,我正在为我的一个项目使用angularjs。我正在尝试实现一个过滤功能 我正在使用下面的代码构建过滤器复选框 <div class="checkbox" ng-repeat="incidentType in keywords.incidentType"> <label><input type="checkbox" value={{incidentType}}>{{incidentType}}</label> </div> 关于如何在a

我正在为我的一个项目使用angularjs。我正在尝试实现一个过滤功能

我正在使用下面的代码构建过滤器复选框

<div class="checkbox" ng-repeat="incidentType in keywords.incidentType">
<label><input type="checkbox" value={{incidentType}}>{{incidentType}}</label>
</div>

关于如何在angularjs中实现这一点的任何想法。非常感谢您提供的任何帮助。

对于类似的内容,您可以使用一个类似于您想要发送的对象作为模型,然后将其绑定到ng repeat中的数据。我让您先在这里查看:
我已经获取了您的示例代码,并且在每个复选框中添加了一个带有对象(
$scope.checked
)的控制器,该对象用于ng模型

$scope.checked={application:{}, incidentType:{}};  
然后,在HTML中

<div class="checkbox" ng-repeat="incidentType in keywords.incidentType">
<label><input type="checkbox" ng-model='checked.incidentType[incidentType]' ng-true-    value='{{incidentType}}'>{{incidentType}}</label>
</div>
这实际上非常接近,您可以从中创建请求(或轻松地重新创建所需的相同对象)

希望这有帮助,玩得开心


=)

对于类似的内容,您可以使用像要发送的对象这样的对象作为模型,然后将其绑定到ng repeat中的数据。我让您先在这里查看:
我已经获取了您的示例代码,并且在每个复选框中添加了一个带有对象(
$scope.checked
)的控制器,该对象用于ng模型

$scope.checked={application:{}, incidentType:{}};  
然后,在HTML中

<div class="checkbox" ng-repeat="incidentType in keywords.incidentType">
<label><input type="checkbox" ng-model='checked.incidentType[incidentType]' ng-true-    value='{{incidentType}}'>{{incidentType}}</label>
</div>
这实际上非常接近,您可以从中创建请求(或轻松地重新创建所需的相同对象)

希望这有帮助,玩得开心


=)

成功了。正是我想要的。谢谢你的帮助。它成功了。正是我想要的。谢谢你的帮助。