【问题标题】:Filter In Angularjs object have array [duplicate]Angularjs对象中的过滤器有数组[重复]
【发布时间】:2017-10-30 13:35:54
【问题描述】:

我想过滤对象数组我的结果是代理数组

[
{
 "id": 1,
"queue_id": 15,
"agent_id": 3,
"level": 0,
"position": 0,
"created_at": "2017-05-29T17:45:08.000Z",
"updated_at": "2017-05-29T17:45:08.000Z",
"callcenter_agent": {
  "id": 3,
  "name": "1254",
  "type": "1",
  "status": null,
  "max_no_answer": 0,
  "wrap_up_time": 5,
  "reject_delay_time": 5,
  "busy_delay_time": 5,
  "no_answer_delay_time": 5,
  "user_number_id": 35,
  "created_at": "2017-05-29T17:30:14.000Z",
  "updated_at": "2017-05-29T17:30:14.000Z"
 }
},
{
  "id": 2,
  "queue_id": 15,
  "agent_id": 4,
  "level": 0,
  "position": 0,
  "created_at": "2017-05-29T17:45:24.000Z",
  "updated_at": "2017-05-29T17:45:24.000Z",
  "callcenter_agent": {
  "id": 4,
  "name": "3658",
  "type": "1",
  "status": null,
  "max_no_answer": 0,
  "wrap_up_time": 5,
  "reject_delay_time": 5,
  "busy_delay_time": 5,
  "no_answer_delay_time": 5,
  "user_number_id": 36,
  "created_at": "2017-05-29T17:30:27.000Z",
  "updated_at": "2017-05-29T17:30:27.000Z"
}
}
];

我想用角度过滤器过滤 callcenter_agent.name 我的 html 代码是

 <li ng-click="selectagents(x)" ng-repeat="x in agents | filter:
    {callcenter_agent.name : checkagents } ">
   <a ng-bind="x.callcenter_agent.name"> </a>
 </li>

但是我如何在 callcenter_agents 中过滤名称是错误的?
我想为 voip 编写呼叫中心经理

【问题讨论】:

    标签: angularjs


    【解决方案1】:

    像这样修改过滤器

    <li ng-click="selectagents(x)" ng-repeat="x in agents | filter:{callcenter_agent: {name: checkagents}}"">
       <a ng-bind="x.callcenter_agent.name"> </a>
     </li>
    

    【讨论】:

    • 非常感谢你
    猜你喜欢
    • 2023-01-02
    • 2019-03-12
    • 2016-02-14
    • 2017-06-29
    • 1970-01-01
    • 1970-01-01
    • 2018-07-17
    • 2016-10-03
    • 2017-12-23
    相关资源
    最近更新 更多