简体   繁体   English

html / Angular中的嵌套括号

[英]Nested brackets in html/Angular

I'm currently stuck trying to access a value in jade from Angular. 我目前一直在尝试从Angular访问玉中的值。 The simple code snippet is shown below: 简单的代码片段如下所示:

td(ng-repeat="part in part_arr")
  {{part_obj_val[{{part}}]["percentage"]}}

When I replace {{part}} with the value it outputs, it works but when I replace the value with {{parts}}, it does not work. 当我用输出的值替换{{part}}时,它可以工作,但是当我将值替换为{{parts}}时,它不工作。 Any ideas? 有任何想法吗?

Edit: can be explained in html or jade 编辑:可以用html或jade解释

您不想使用插值,将其作为变量传递给您,就像处理任何JavaScript一样

{{part_obj_val[part]["percentage"]}}

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

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