简体   繁体   English

jsrender-从复杂结构访问元素

[英]jsrender- access elements from complex structure

Im using JsRender Library for getting elements from a rest call as json this is my Json structure: 我正在使用JsRender Library从REST调用中获取元素作为json,这是我的Json结构:

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

I am trying to the access the status but I cannot, I have tried 我正在尝试访问状态,但不能,我已经尝试过

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

but none of these worked for me. 但是这些都不适合我。 any suggestions ? 有什么建议么 ?

I found the answer: 我找到了答案:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM