如何在把手中显示数组json中的数据?

时间:2015-10-17 07:14:52

标签: javascript html json ajax handlebars.js

以下是来自服务器的json我想只打印名称表单客户列表

var PatientList = [{
  "Customer": [{
    "phone": 1234567890,
    "name": "customer"
  }],
  "Patients": [{
    "age": null,
    "relationship": null,
    "id": 5,
    "weight": null,
    "name": "customer"
  }],
  "Lead": [{
    "source": 1,
    "id": 3,
    "service": 3
  }]
}];

1 个答案:

答案 0 :(得分:0)

{{#each PatientList}}
  {{#each Customer}}
    <div>{{name}}</div>
  {{/each}}
{{/each}}