JSrender- 从复杂结构访问元素

jsrender- access elements from complex structure

本文关键字:访问 元素 结构 复杂 JSrender-      更新时间:2023-09-26

我使用 JsRender 库从 rest 调用中获取元素作为 json这是我的 Json 结构:

{
   "bugs" : [
      {
         "component" : "Rx",
         "resolution" : "",
         "status" : "NEW",
         "summary" : "There is a big delay"
      },
      {
         "component" : "Rx",
         "resolution" : "",
         "status" : "NEW",
         "summary" : "problem"
      }
   ]
}

我正在尝试访问状态,但我不能,我试过了

{{:bugs.status}}
{{>~status}}

但这些都不适合我。有什么建议吗?

我找到了答案:

{{for bugs}}
{{:status}}
</br>
    {{/for}}