我的车把代码有什么问题?

时间:2019-06-28 14:21:58

标签: node.js handlebars.js

我的车把代码有什么问题?我想打印“ availability”数组的数据。作为响应,所有其他字段的数据都被打印了,但在“ availability”字段中显示了空白页。是我的代码,然后是我要从中访问“可用性”数组字段的格式。

<body>
<table>
    {{#each availability}}
    <tr>
         <td><div>{{this.date}}</div></td>
        <td><div>{{this.status}}</div></td></tr>
    {{/each}}
</table>
</body>

======below is the format which I want to access========
{
  "response_code": 200,
  "debit": 3,
  "train": {
    "name": "NDLS SHATABDI E",
    "number": "12001"
  },
  "from_station": {
    "lat": 23.2599333,
    "name": "BHOPAL  JN",
    "lng": 77.412615,
    "code": "BPL"
  },
  "to_station": {
    "lat": 30.6016778,
    "name": "NEW DELHI",
    "lng": -98.3488272,
    "code": "NDLS"
  },
  "journey_class": {
    "name": "AC CHAIR CAR",
    "code": "CC"
  },
  "quota": {
    "name": "GENERAL QUOTA",
    "code": "GN"
  },
  "availability": [
    {
      "date": "14-07-2017",
      "status": "AVAILABLE 364"
    },
    {
      "date": "15-07-2017",
      "status": "AVAILABLE 361"
    },
    {
      "date": "16-07-2017",
      "status": "AVAILABLE 284"
    },
    {
      "date": "17-07-2017",
      "status": "AVAILABLE 351"
    },
    {
      "date": "18-07-2017",
      "status": "AVAILABLE 303"
    },
    {
      "date": "19-07-2017",
      "status": "AVAILABLE 329"
    }
  ]
}

0 个答案:

没有答案