0

JSON 它来自:

unverifiedCompanies=[{"email":"testcompany@company.com","company_number":"09999999","company_name":"Name_123","full_name":"test","phone_number":"xyz"},{"email":"testtwo@company.com","company_number":"09999999","company_name":"Name_123","full_name":"test","phone_number":"xyz"}]

迭代

{{#each unverifiedCompanies}}
<tr>
  <td>{{this}}</td>
  <td>{{this.company_name}}</td>
  <td>{{this.full_name}}</td>
  <td>{{phone_number}}</td>
  <td>{{email}}</td>
</tr>
{{/each}}

但是,仅{{this}}显示{"email":"testcompany@company.com","company_number":"09999999","company_name":"Name_123","full_name":"test","phone_number":"xyz"}{"email":"testtwo@company.com","company_number":"09999999","company_name":"Name_123","full_name":"test","phone_number":"xyz"}所有其他都不会显示。

我错过了什么吗?

4

1 回答 1

0

用大括号 {} 将您的内容包裹起来,以便将其保存为 JSON 格式。我猜你遇到的问题是 unverifiedCompanies 没有解决。

{unverifiedCompanies=[{"email":"testcompany@company.com","company_number":"09999999","company_name":"Name_123","full_name":"test","phone_number":"xyz"},{"email":"testtwo@company.com","company_number":"09999999","company_name":"Name_123","full_name":"test","phone_number":"xyz"}]}
于 2016-09-26T09:14:03.610 回答