AngularJS过滤器或组合

时间:2016-12-05 13:28:26

标签: angularjs filter

我使用AngularJS 1.5.8并且我需要我的用户的过滤器:带有文本输入字段的下拉框(vm.selectedUser)(searchEmployeesText): 只有下拉框看起来像这样并且工作正常:

| filter: {user: {surname: vm.selectedUser.surname}}

实际上我不知道两种方法都使用哪种方法:

| filter: {user: {surname: vm.selectedUser.surname or searchEmployeesText}}         (this does not work but only to show what I would neet)

1 个答案:

答案 0 :(得分:0)

尝试在您的条件之间使用||代替or

| filter: {user: {surname: vm.selectedUser.surname}} || {user: {surname: earchEmployeesText}}"

另请查看this answer以了解更多条件。