我有以下两个选择框;
<select name="primary_communication" id="primary_communication" class="form-control"
data-ng-model="addCareAdminController.careAdminModel.primaryCommunication"
data-ng-options="type.code as type.description for type in addCareAdminController.communicationTypes">
<option value="">Select Primary Communication</option>
</select>
<select name="secondary_communication" id="secondary_communication" class="form-control"
data-ng-model="addCareAdminController.careAdminModel.secondaryCommunication"
data-ng-options="type.code as type.description for type in addCareAdminController.communicationTypes">
<option value="">Select Secondary Communication</option>
</select>
将相同的对象数组作为值;
self.communicationTypes = [
{code: "CMPH", groupCode: "COMM-METH", description: "Mobile Phone"}
{code: "CWPH", groupCode: "COMM-METH", description: "Work Phone"}
{code: "CPNO", groupCode: "COMM-METH", description: "Pager Number"}
{code: "CEMA", groupCode: "COMM-METH", description: "Email"}
]
我需要一个自定义过滤器,它执行以下操作。如果我在主通信选择框中选择了任何选项(如手机),我希望从辅助通信选择框中删除该选项。同样,反之亦然。
我试过这篇文章中给出的解决方案
link
,但这对我不起作用。此外,他们还没有提供定制的过滤器解决方案。请帮我做这个。